Tell us what’s happening:
Your code so far
var Person = function(firstAndLast) {
// Complete the method below and implement the others similarly
var c=firstAndLast;
var d=c.split(" ");
this.FirstName=d[0];
this.LastName=d[1];
return{
var getFirstName:function(){
return this.FirstName;
};
var getLastName:function (){
return this.LastName;
};
getFullName :function() {
return this.FirstName+" "+this.LastName;
};
this.setFirstName=function(first){
this.FirstName=first;
};
setLastName:function(last){
this.LastName=last;
};
setFullName:function(firstandLast){
var b=firstandLast;
var c=b.split(" ");
this.FirstName=c[0];
this.LastName=c[1];
};
}
};
var bob = new Person('Bob Ross');
bob.getFullName();
bob.setFullName("Haskell Curry");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person