Intermediate Algorithm Scripting - Make a Person

Tell us what’s happening:
Describe your issue in detail here.

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 = function() {
    return firstAndLast; 
  };

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

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

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

  this.setLastName = function(last) {
      firstAndLast = firstAndLast.split(" ")[0] + " "+last
      return firstAndLast
  };

  this.setFullName = function(first,last) {
    firstAndLast = first +" " +last ; 
    return firstAndLast
  };

  
};






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/116.0.0.0 Safari/537.36

Challenge: Intermediate Algorithm Scripting - Make a Person

Link to the challenge:

You’ve changed the number of function arguements from two to one.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.