Stuck on exercise 16 "its all in the genes", keep getting an unexpected identifier error?


#1

As in the title, I've been stuck on this for ages


https://www.codecademy.com/courses/objects-ii/3/1?curriculum_id=506324b3a7dffd00020bf661

Just says 'syntax error: unexpected identifier'


// create your Animal class here
Function Animal(name,numLegs){
    this.name = name;
    this.numLegs = numLegs;
};



// create the sayName method for Animal
Animal.prototype.sayName = function(){
    console.log("Hi my name is " + this.name);
};


#2

keywords are case-sensitive, Function and function are two different things


#3

Hi astijfequn!

You need to change the the "f" in your function should be in lowercase (i.e. "function" NOT "Function").

Cheers!


#4

in which does your answer differ from mine>?


#5

They are both the same. I didn't realize you had replied until after I posted mine.

Sincere apologies!


#6

There are two things here you should change...

First, your function has to be in lowercase not titlecase i.e. function not Function.

secondly, change the ; to , and dont include, after numLegs i.e..

function Animal(name,numLegs){
this.name = name,
this.numLegs = numLegs
};


#7

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