Javascript Lesson 23. More Options: Sally and Holden


With this exercise, no matter what I do, I keep getting syntax errors that the species variable is undefined, that the age variable is undefined, etc. even after initializing the variables using the provided function.

"TypeError: Cannot read property 'species' of undefined"

Once setting the variable "sally" and setting the name and age, I would expect that these variables would then be defined. For some reason, there doesn't seem to be persistence with any of the variables defined using the Person() function, and so nothing done with that function makes a difference outside the scope of said function. I have been stumped on this step for over a week now.

function Person(name,age) { = name;
  this.age = age;
  this.species = "Homo Sapiens";

var sally = Person("Sally Bowles", 39);
var holden = Person("Holden Caulfield", 16);

console.log("sally's species is " + sally.species + " and she is " + sally.age);
console.log("holden's species is " + holden.species + " and he is " + holden.age);


the exercise url leads to a 404 page, can you please post an updated url?


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