js原型链

         function Proson(name,age) {
             this.name = name;
             this.age = age;
         }
         var proson = new Proson('小庄',21);
         console.log(proson);

         console.log(proson.__proto__ === Proson.prototype); 
         console.log(Proson.__proto__ === Function.prototype);
         console.log(Function.__proto__ === Object.__proto__); //重点1
         console.log(Function.__proto__.__proto__ === Object.prototype);  //重点
console.log(Function.prototype.__proto__ === Object.prototype); //重点
         

 因为:四种普通对象三种原型对象

 黑线 ,变量寻找路径

黄线:是箭头左边创建出来的

posted @ 2021-04-10 12:33  小庄的blog  阅读(50)  评论(0编辑  收藏  举报