标签:evel 题目 交互 构造 字符 gui eve model developer
1.要求
2.思路
3.代码
var Person = function(firstAndLast) {
var firstName=firstAndLast.split(' ')[0];
var lastName=firstAndLast.split(' ')[1];
this.getFirstName=function(){
return firstName;
};
this.getLastName=function(){
return lastName;
};
this.getFullName=function(){
return firstName+' '+lastName;
};
this.setFirstName=function(first){
firstName=first;
};
this.setLastName=function(last){
lastName=last;
};
this.setFullName=function(firstAndLast){
firstName=firstAndLast.split(' ')[0];
lastName=firstAndLast.split(' ')[1];
};
return firstAndLast;
};
var bob = new Person('Bob Ross');
bob.getFullName();
4.相关链接
Make a Person-freecodecamp算法题目
标签:evel 题目 交互 构造 字符 gui eve model developer
原文地址:https://www.cnblogs.com/ahswch/p/9307751.html