Tell us what’s happening:
I don’t get is it correct expected output
" bob.getFullName()
should return “Haskell Curry” after bob.setLastName("Curry")
."
It is the only criteria in this task which i can’t pass and i don’t understand why getFullName should has first and last name changed if we set only last name
Your code so far
var Person = function(first,Last) {
// Complete the method below and implement the others similarly
this.getFullName = function() {
return first + " " + Last;
}
this.getFirstName = function() {
return first;
}
this.getLastName = function() {
return Last;
}
this.setFirstName = function(input) {
first = input;
}
this.setLastName = function(input) {
Last = input;
}
this.setFullName = function(input) {
let lt = input.split(" ");
first = lt[0];
Last = lt[1];
}
};
var bob = new Person('Bob','Ross');
bob.setLastName("Curry")
console.log(bob.getFullName());
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person