摘要: function foo() { this.name = 'foo'; }Function.prototype.sayHello = function (parent) { console.log(this.name);}; console.log(foo.__proto__ Function.pr 阅读全文
posted @ 2021-10-12 18:06 果果1024 阅读(155) 评论(0) 推荐(1)
摘要: 当new Object()不传参数时,字面量{}和new关键字创建的对象是Object的实例,原型指向Object.prototype,继承内置对象ObjectObject.create(arg, pro)创建的对象的原型取决于arg,arg为null,新对象是空对象,没有原型,不继承任何对象;ar 阅读全文
posted @ 2021-10-12 16:54 果果1024 阅读(55) 评论(0) 推荐(0)