23. More Options



I'm not quite sure what I'm doing wrong, here is the error code I am recieving:

Oops, try again. Your code threw the following error when sally's name was checked: TypeError: Cannot read property 'name' of undefined

Here is my code:

function Person(name, age) {
    this.name = 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);


Nevermind... I just realized i didn't use new when defining sally and/or holden...


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