https://zhuanlan.zhihu.com/p/62903507
原型
image.png
function Person(){}
var person = new Person();
person.__proto__ === Person.prototype // true
Person.prototype.constructor === Person // true
原型链
image.png
https://zhuanlan.zhihu.com/p/62903507
image.png
function Person(){}
var person = new Person();
person.__proto__ === Person.prototype // true
Person.prototype.constructor === Person // true
image.png
本文标题:js 原型 原型链
本文链接:https://www.haomeiwen.com/subject/kkhapdtx.html
网友评论