More Options - creating Sally and Holden objects


Hi! I created the Sally and Holden objects, then added their age properties to the console log. What am I missing or what did I do incorrectly?

The error message says: "TypeError: Cannot read property 'species' of undefined"

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);

Thank you for your help!


When invoking a constructor, be sure to use the new operator.


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