Person.prototype={
constructor:Person,//告诉我们当前对象是由那个对象产生的
LEGS:2,
sayHi:function(){
console.log('Hello, I am ' + this.name+ ', I am '+this.age+' years old, and '+'I have '+this.LEGS+' legs') },
showName:function(){
console.log('I am '+this.name);
},
showAge:function(){
console.log('I am '+this.age + ' years old');
}
不知道你这个问题是否已经解决, 如果还没有解决的话: