JS 原型和原型链总结

function Student(){}   //创建一个函数

var str = new Student();     // new 一个对象

 

str.__proto__ ===  Student.prototype   //true    

实例str的__proto__ 等价于,函数Student的原型prototype

 

str.__.proto__.__proto__ === Student.prototype.__proto__;  //true

str.__proto__.__proto__ === Object.prototype   // true

Student.prototype.__proto__ === Object.prototype  //true

posted on 2020-08-06 14:28  Steven_YF  阅读(0)  评论(0编辑  收藏  举报