Tell us what’s happening:
It seems correct,but it can’t pass.
Your code so far
var Person = function(firstAndLast) {
let name = firstAndLast.split(' ');
this.getFullName = function() {
return name[0] + ' ' + name[1];
};
this.getFirstName= function(){
return name[0];
};
this.getLastName= function(){
return name[1];
};
this.setFirstName= function(first){
name[0] = first;
};
this.setLastName= function(last){
name[1] = last;
};
this.setFullName= function(firstAndLast){
name[0]=firstAndLast.split(' ')[0];
name[1]=firstAndLast.split(' ')[1];
};
};
var bob = new Person('Bob Ross');
//bob.setLastName('Curry');
//bob.setFirstName('Haskell');
console.log(bob.getFirstName());
console.log(bob.getLastName());
console.log(bob.getFullName());
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person/