function Person(name,age){

  this.name = name;

  this.age = age;

}

var person1 = new Person('jay',24);

console.log(person1.prototype); //undefined

console.log(person1.__proto__ === Person.prototype); //true

console.log(Person.__proto__ === Function.prototype);//true

console.log(Function.prototype.__proto__ === Object.prototype);//true

console.log(Object.prototype.__proto__);//null

 

总结:

1.prototype是构造函数的属性

2.__proto__是对象的属性

3.函数也是对象,所以也有__proto__属性  为函数的构造函数Function的原型对象

4.对象的prototype为undefined

posted on 2021-05-29 14:36  皮杰克  阅读(49)  评论(0编辑  收藏  举报