function Star(name, age) {
this.name = name;
this.age = age;
this.sing = function () {
console.log(this.name + '会唱歌');
}
}
var ht = new Star('河图', 3);
//每一个构造函数都有prototype属性,该属性指向一个对象
//实例化对象都会有一个属性__proto__,指向构造函数的原型对象prototype
console.log(Star.prototype); //constructor: ƒ Star(name, age)
console.log(Star.prototype == ht.__proto__); //true
//原型对象prototype的构造函数construor指向Star构造函数
console.log(Star.prototype.constructor == Star); //true
//Star原型对象prototype.__proto__指向Object原型对象prototype
console.log(Star.prototype.__proto__ == Object.prototype); //true
//Object原型对象prototype的构造函数construor指向Object构造函数
console.log(Object.prototype.constructor == Object); //true
//Object原型对象prototype.__proto__指向空null
console.log(Object.prototype.__proto__); //null