23. More Options (Stuck) (Solved, I'm just silly)


Hi I'm stuck in the (outdated) JavaScript course. I've already done and finished the updated one, but wanted to do that one too, because I have too much free time. However now I'm at 70% and absolutely stuck. I already looked up and found even the exact code I need to use and it looks EXACTLY like mine, except mine doesn't work.
Is there any Error I might've missed after all? I'm so desperate, I don't want to leave this course at 70% in my list and have to abandon it.

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

The Error that the course gives me says

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

and the Error the console gives me says

TypeError: Cannot read property 'species' of undefined

which is already weird, because the Errors don't even match (although I get the one that the course tells me when I remove the sally.species part).

Thanks in advance!


to create a sally object using the person constructor requires the new keyword, remember?


i'm so stupid!! of course, oh my god
i feel really stupid now, wow.

thank you, though!!