构造函数的原型对象上定义一个对象

function a(){
this.sex=[1,2,3]
}
a.prototype={
age:[1,2,3],
say:function(){

}
}
var b=new a();
b.age.push(4)
console.log(a.prototype)
console.log(b.age)
var c=new a();
console.log(a.prototype)
console.log(c.age)

posted @ 2018-06-25 09:16  天马行空的Max  阅读(77)  评论(0)    收藏  举报