js 原型 原型链
2023-08-09 本文已影响0人
hehehehe
https://zhuanlan.zhihu.com/p/62903507
原型
![](https://img.haomeiwen.com/i8187022/f8ba0dcdd216bd41.png)
function Person(){}
var person = new Person();
person.__proto__ === Person.prototype // true
Person.prototype.constructor === Person // true
原型链
![](https://img.haomeiwen.com/i8187022/639cbef46bd32574.png)
https://zhuanlan.zhihu.com/p/62903507
function Person(){}
var person = new Person();
person.__proto__ === Person.prototype // true
Person.prototype.constructor === Person // true