摘要: 通过hasOwnProperty('name') 来查看是否是自己的属性 1.原型 // class实际上是函数,可见是语法糖 typeof Student //"function" typeof People //"function" // 隐式原型 和 显示原型 console.log(aaa. 阅读全文
posted @ 2020-03-19 18:35 chenlw101 阅读(138) 评论(0) 推荐(0) 编辑
摘要: // 父类 class People{ constructor(name){ this.name = name; } eat(){ console.log(`姓名 ${this.name} eat something `) } } // 子类 class Student extends People 阅读全文
posted @ 2020-03-19 17:39 chenlw101 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 1.数据类型:值类型(Number,String,Boolean,undefined),引用类型(object(包含数组),Null),函数 2.typeod 判断所有的值类型,函数。引用类型无法区分(都是object) 3.深拷贝 3.深拷贝 const obj1 = { age:20, name 阅读全文
posted @ 2020-03-19 16:45 chenlw101 阅读(145) 评论(0) 推荐(0) 编辑