Tell us what’s happening:
Describe your issue in detail here.
Hello, I completed the “Make a Person” challenge with the code below.
However the solution copies the function parameter “firstAndLast” at the top of the function with
let fullName = firstAndLast;
then uses that instead of “firstAndLast” as I did in my code.
Why make the copy? Seems to work the same without it. What am I missing?
Thank you!
**Your code so far**
const Person = function(firstAndLast) {
// Only change code below this line
// Complete the method below and implement the others similarly
this.getFullName = () => firstAndLast;
this.getFirstName = () => firstAndLast.split(" ")[0];
this.getLastName = () => firstAndLast.split(" ")[1];
this.setFirstName = x => {
firstAndLast = x.split(" ")[0] + " " + firstAndLast.split(" ")[1]
}
this.setLastName = y => {
firstAndLast = firstAndLast.split(" ")[0] + " " + y;
}
this.setFullName = z => {
firstAndLast = z.split(" ")[0] + " " + z.split(" ")[1];
}
};
const bob = new Person('Bob Ross');
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36
Challenge: Make a Person
Link to the challenge: