Make a Person ,not able to pass the first test case

Tell us what’s happening:

Your code so far


var Person = function(firstAndLast) {
  // Complete the method below and implement the others similarly
  var c=firstAndLast;
  var d=c.split(" ");
 this.FirstName=d[0];
 this.LastName=d[1];
 
 return{
 var getFirstName:function(){
    return this.FirstName;
  };
var  getLastName:function (){
     return this.LastName;
  };
  
  
  
  getFullName :function() {
  
    return this.FirstName+" "+this.LastName;
  };
  
   this.setFirstName=function(first){
   this.FirstName=first;

  };

  setLastName:function(last){

      this.LastName=last;

  };
  setFullName:function(firstandLast){
   var b=firstandLast;
   var c=b.split(" ");
   this.FirstName=c[0];
   this.LastName=c[1];
   
   
  };
 }
};

var bob = new Person('Bob Ross');
bob.getFullName();
bob.setFullName("Haskell Curry");

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/make-a-person

This one got me too: you have to use a closure for this challenge, and not keep firstName and lastName as properties. Just replace this.FirstName with just firstName everywhere, and do the same for lastName. It works because the two variables will stay in scope for each of the methods.

IMHO this is a poorly designed challenge, since closures are not even covered before this.