[Make a Person] has a bug
Kenvas opened this issue · comments
Kenvas commented
Challenge Make a Person has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
var Person = function(firstAndLast) {
var firstName="";
var lastName="";
this.getFirstName=function(){
console.log('getFirstName',firstName);
return firstName;
};
this.getLastName=function(){
console.log('getLastName',lastName);
return lastName;
};
this.getFullName=function(){
var retval=[firstName, lastName].join(' ');
console.log('getFullName',retval);
return retval;
};
this.setFirstName=function(x){
console.log('setFirstName',x);
firstName=x;
};
this.setLastName=function(x){
console.log('setLastName',x);
lastName=x;
};
this.SetFullName=function(x){
var arr=x.split(' ');
console.log('SetFullName', arr);
firstName=arr[0];
lastName=arr[1];
};
this.SetFullName(firstAndLast);
return this;
};
var bob = new Person('Bob Ross');