- 从构造函数获得原型对象
构造函数.prototype
- 从对象实例获得原型对象
对象实例.__prpto__
Object.getPrototypeOf(对象实例)
示例:
function Student(){
this.name = "小马扎";
this.age = 18;
}
var lilei = new Student(); // 创建对象实例
console.log(Student.prototype); //Student{}
console.log(lilei.__proto__); //Student{}
console.log(Object.getPrototypeOf(lilei)); //Student{}