Tell us what’s happening:
Your code so far
var Person = function(firstAndLast) {
var array = firstAndLast.split(" ");
this.getFirstName = function() {
return array[0];
};
this.getLastname = function() {
return array[1];
};
this.getFullName = function() {
return array[0] + " " + array[1];
};
this.setFirstName = function(first) {
array[0] = first;
};
this.setLastName = function(last) {
array[1] = last;
};
this.setFullName = function(firstAndLast) {
var arraySplit = firstAndLast.split(" ");
this.setFirstName(arraySplit[0]);
this.setLastName(arraySplit[1]);
};
};
var bob = new Person('Bob Ross');
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:76.0) Gecko/20100101 Firefox/76.0
.
Challenge: Make a Person
Link to the challenge:
Two tests are still coming in wrong.
bob.getLastName()
should return “Ross”.
bob.getLastName()
should return “Curry” after bob.setFullName("Haskell Curry")
.
What is wrong? Thank you for your help.