I’m on the Make a Person Algorithm, my code is as follows:

``````
var Person = function(firstAndLast) {

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

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

this.getFullName = function () {
return this.first + " " + this.last;
};

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

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

this.setFullName = function (full) {
this.first = full.split(" ")[0];
this.last = full.split(" ")[1];
this.full = this.first + " " + this.last;
};

this.setFirstName(firstAndLast.split(" ")[0]);
this.setLastName(firstAndLast.split(" ")[1]);
this.setFullName(firstAndLast);
};

var bob = new Person('Bob Ross');
bob.getFullName();

``````

Every test checks except the bob’s length is not 6, my question is that the constructor only has 6 methods, why does the length not return 6?

I actually count 9 methods, be it setters or getters.

[spoiler]var Person = function(firstAndLast) {
var arr = firstAndLast.split(’ ');
var firstName = arr[0] || “”;
var lastName = arr[1] || “”;
var nameSurname = firstAndLast;

this.setFirstName = function(fN){
firstName = fN;
};

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

this.setLastName = function(lN){
lastName = lN;
};

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

this.setFullName = function(firstAndLast){
nameSurname = firstAndLast;
};

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

var bob = new Person(‘Bob Ross’);
bob.getFirstName();
//bob.getFullName();[/spoiler]

Spoiler alert, my solution for the problem.

Are the calls to methods counted properties, as well?