23 - what on Earth is wrong with my code?


#1

I can't figure out what's going wrong with my code for 23. Can anyone give me some pointers?
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 " + );
console.log("holden's species is " + holden.species + " and he is " + );


#2

Hi @anfperez,

If it may help please see the code example below. Going on the guess of what your error might be and the fact you have pasted the code here, I took the approach you were probably trying to display the Name and Age for each object, and if that was the case then you were just missing the final reference to the age property, if we throw this in you're good to go and that display your sentence for Both Sally & Holden.

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); //added the property for sally.age
console.log("holden's species is " + holden.species + " and he is " + holden.age); //added the property for holden.age

#3

Thank you so much for clearing that up for me! I appreciate it!