function Dog(name, age){
this.name = name,
this.age = age
}
Dog.prototype.proCount = function(){
var count = 0
for(pro in this){
count++;
}
return count
}
var dog = new Dog('大毛', 12);
console.log(dog.proCount())
取dog对象里属性的个数 可是得出 3 ,为什么
aluckdog
相关分类