23. More options: unexpected token


#1

https://www.codecademy.com/en/courses/spencer-sandbox/3/4?curriculum_id=506324b3a7dffd00020bf661#

I don't know why but I have a error " SyntaxError: Unexpected token )". In my opinion is everything correct.
Any ideas? Thanks

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

You forgot to put the age function in the console log like so:

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

#3

I have checked my code many times but fails to find out error ....
it is showing two errors person is not defined and Your code threw the following error when sally's name was checked: TypeError: Cannot read property 'name' of undefined

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


#4

new Person should be with a Upper-case P


#5

@funct1on

waw it did works ....
thanks funct1on :slight_smile:


#6

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