Intermediate Algorithm Scripting - Make a Person

Tell us what’s happening:
Describe your issue in detail here.
Not passing the test for function signature.

Your code so far

const Person = function(first, Last) {
  
  let firstName = first;
  let lastName  = Last;

  this.getFirstName = function() {
    return firstName;
  };

  this.getLastName = function() {
    return lastName;
  };

  this.getFullName = function() {
    return this.getFirstName() + " " + this.getLastName();
  };

  this.setFirstName = function(first) {
    return firstName = first;
  };

  this.setLastName = function(last) {
    return lastName = last;
  };

  this.setFullName = function(first, last) {
    this.setFirstName(first);
    this.setLastName(last);
    return this.getFullName();
  };
};

const bob = new Person("Bob", "Ross");
console.log(bob.getFullName());

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Challenge: Intermediate Algorithm Scripting - Make a Person

Link to the challenge:

Welcome to our community!

You have changed the argument’s name from “last” to “Last”:

const Person = function(first, Last) {
  
  let firstName = first;
  let lastName  = Last;

Thank you so much. it works now.

1 Like

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