摘要: class Person{ constructor(name,age){ //类的构造函数,实例化的时候执行,new的时候执行 this._name=name; this._age=age; } getName(){ console.log(this._name) } setName(name){ this._name=name } } var p =new Person('ssj',23) p. 阅读全文
posted @ 2019-08-19 18:03 聂小恶 阅读(109) 评论(0) 推荐(0) 编辑
摘要: //继承 call 原型链+对象冒充方法实现 function Person(name,age){ this.name=name; this.age=age; this.run=function(){ console.log(this.name+' '+this.age); } } Person.prototype.work=function(){ } function Web(name,age) 阅读全文
posted @ 2019-08-19 17:24 聂小恶 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 重点:删除node,彻底删除node再安装nvm 完全卸载node https://www.cnblogs.com/fighxp/p/7410235.html 安装和使用 https://www.jianshu.com/p/d0e0935b150a 阅读全文
posted @ 2019-08-19 17:24 聂小恶 阅读(267) 评论(0) 推荐(0) 编辑
摘要: function Person(name,age){ //构造函数里面的方法和属性 this.name=name; this.age=age; this.run=function(){ console.log(`${this.name}------${this.age}`); } } //原型链上面的属性和方法 原型链上的属性和方法可以... 阅读全文
posted @ 2019-08-19 16:41 聂小恶 阅读(387) 评论(0) 推荐(0) 编辑