Make a Person-Intermediate Algorithms

*I can’t get my code to pass the last three tests with Haskell Curry on free code camp js editor. I run the same code on VS Code with Node.js and it works fine.

  **Your code so far**
var Person = function(firstAndLast) {
  let fullName  = firstAndLast;   

  this.getFirstName = function() {
    return fullName.split(" ")[0];
  };

  this.getLastName = function() { 
    return fullName.split(" ")[1];
  };

  this.getFullName = function() {
    return fullName;
  };   

  this.setFirstName = function (first) {
    fullName = first + " " + fullName.split(" ")[1]; 
    return; 
  };

  this.setLastName = function (last) {
    fullName = fullName.split(" ")[0] + " " + last;
    return; 
  };
  this.setfullName = function(name) {
    fullName  = name;  
    return; 
  }; 
};
  **Your browser information:**

Microsoft Edge
Version 89.0.774.57 (Official build) (64-bit)
Windows 10

Challenge: Make a Person

Link to the challenge:

Hey!
There’s a small capitalization error in your code.

Check the tests and see what the proper syntax of this part should be compared to how you put it :slight_smile:
Hope it helps!

Thanks for the help. This has been driving me nuts. Two problems: first the lowercase ‘f’ and I made things worse for myself as I must have used cut and paste and used the same error in my test data which was then running ok. Thanks again

1 Like