function Person(){ }; Person.prototype.name = "Nicholas"; Person.prototype.age = 29; console.log(Person.name); //Person console.log(Person.age); //undefined
这段代码,为什么Person.name会打印出Person,而不是像Person.age一样打印出undefined?
浮云间
相关分类