JS原型链详细图解

__proto__ 和 prototype 的关系

__proto__ 是每个对象都有的属性;prototype是构造函数的属性;他们指向的是同一个对象。

例如:

function F(){};

var f = new F();

f.__proto__ === F.prototype  //true



猜你喜欢

转载自blog.csdn.net/a790012863/article/details/80144922