关于一个js的问题,请求大佬帮帮忙~
functionperson(first,last,age,eye){this.firstName=first;this.lastName=last;this.age=a...
function person(first,last,age,eye){
this.firstName = first;
this.lastName = last;
this.age = age;
this.eyeColor = eye;
}
var myFather = new person(‘John’ , ‘Doe’ , 50 , ‘blue’);
请问一下,这个需要怎么输出啊?大佬们,谢谢啦,爱你们~ 展开
this.firstName = first;
this.lastName = last;
this.age = age;
this.eyeColor = eye;
}
var myFather = new person(‘John’ , ‘Doe’ , 50 , ‘blue’);
请问一下,这个需要怎么输出啊?大佬们,谢谢啦,爱你们~ 展开
展开全部
function person(first,last,age,eye){
this.firstName = first;
this.lastName = last;
this.age = age;
this.eyeColor = eye;
}
person.prototype.getFirstName=function(){
return this.firstName;
};
var myFather = new person('John' , 'Doe' , 50 , 'blue');
console.log(myFather.getFirstName())
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询