1.现在我们知道,实例对象的__proto__属性指向其对应的原型对象。而在原型对象 prototype 上又有 constructor 和__proto__属性,此时的__proto__又指向上级对应的原型对象,最终指向Object.prototype, 而Object.prototype.__proto__ === null。这就构成了原型链,而原型链最终都是指向 null

注:JavaScript仅支持通过prototype属性进行继承属性和方法。
下面是一些联系题:

2.所谓模块化,就是根据需要控制模块内属性与方法的可访问性,即私有或者公开。在代码中,module为一个独立的模块,N为其私有属性,print为其私有方法,decription为其公有属性,add为其共有方法。
3.区位
网友评论