23. More Options


#1

I don't understand why it won't go through. Could someone else point out what I'm doing wrong?


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

var sally = new Person("Sally Bowles", 39);
var holden = new 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);

You have to add 'new' before Person when defining your 'sally' and 'holden' objects.


#3

Thank you so much! It seems so obvious now. :smiley:


#4

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