如下是本身理解的,原文更加详细函数
//方法和对象是同样的
//任何一个函数 都有 5个Prototype 方法或者属性
//优先级 自身的方法大于Prototype
//在Prototype中建立方法 子对象就会被继承prototype
function foo(){
return 'father';
}对象
var son1=new foo();//实例化生成一个子对象
var son2=new foo();//实例化2
foo.age=25;//不会被子对象继承
foo.prototype.sex="man";//动态建立了新的属性 即便已经实例化的子对象继承该属性
son2.constructor.prototype.color="red";//constructor 主动去给父对象增长
son2.prototype.love='tom';//子对象没法使用prototype
console.log(son2.age);//undefined
console.log(son2.sex);//man
console.log(son1.color);//red继承