
js
qq_34626362
这个作者很懒,什么都没留下…
展开
-
es6 class
class语法是es6新加的语法,用于生成一个类,es5时生成类是通过构造函数,看着特别不舒服。es5声明类:// function Point(x,y) { // this.x=x; // this.y=y; // } // // Point.prototype.toString=function () { // return '('+...原创 2018-03-06 15:27:57 · 179 阅读 · 0 评论 -
js 深度克隆函数
function re (obj){ let obj1; obj1=returnType(obj); if(typeof obj1 !== 'object'){ return obj1 } for(var i in obj){ if(typeof obj[i] !=='object'){ obj1[i]=obj[i]; }else{ ...原创 2018-04-17 14:35:56 · 1119 阅读 · 0 评论