Tell us what’s happening:
can’t pass all tests even when I tried on vscode I have got the correct results. Only the last three tests can’t pass on freecodecamp.
bob.getFullName() should return “Haskell Curry” after bob.setFullName("Haskell Curry") .
bob.getFirstName() should return “Haskell” after bob.setFullName("Haskell Curry") .
bob.getLastName() should return “Curry” after bob.setFullName("Haskell Curry") .
Your code so far
var Person = function(firstAndLast) {
// Only change code below this line
// Complete the method below and implement the others similarly
let fullName = firstAndLast;
let firstName = fullName.split(' ')[0];
let lastName = fullName.split(' ')[1];
this.getFullName = function() {
return `${this.getFirstName()} ${this.getLastName()}`;
};
this.setFullName = (full_Name) =>{
fullName = full_Name;
};
this.getFirstName = () =>{
return firstName;
};
this.getLastName = () =>{
return lastName;
};
this.setFirstName = (fName) =>{
firstName = fName;
};
this.setLastName = (lName) =>{
lastName = lName;
};
};
var bob = new Person('Bob Ross');
bob.getFullName();
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36.
Challenge: Make a Person
Link to the challenge: