function Person(first, last, age, eyecolor) {
this.firstName = first;
this.lastName = last;
this.age = age;
this.eyeColor = eyecolor;
}
Person.prototype.name = function() {
return this.firstName + " " + this.lastName;
};
如何给 Person 对象的原型添加方法
最新推荐文章于 2025-06-03 18:54:56 发布