11. Putting it all together... Code not working? Please help


#1

Hi my code isn't working for some reason... Can anyone tell me what's going on? Thanks!
CODE:

// help us make snoopy using literal notation
// Remember snoopy is a "beagle" and is 10 years old.
var snoopy = {
    species: "beagle",
    age: 10,
};
    

// help make buddy using constructor notation
// buddy is a "golden retriever" and is 5 years old
var buddy = new Object();
buddy.species = "golden retriver";
buddy.age = 5

It keeps on saying: Oops, try again. Buddy should have a property named 'species' that is set to 'golden retriever'


#2

You misspelled "retriever".


#3

:laughing: how could I miss that? Lol, thanks. :smile:


#4

You seem to be good at this, Help me?

// help us make snoopy using literal notation
// Remember snoopy is a "beagle" and is 10 years old.
var snoopy = {
    species = "beagle";
    age = 10;
};

// help make buddy using constructor notation
// buddy is a "golden retriever" and is 5 years old
var buddy = new Object();
buddy.species ="golden retriever";
buddy.age = 5;

#5

Inside the object you need to have commas , instead of semicolons ;


#6

I have done that and now I have this error.

missing : after property id


#7

Oh yeah, sorry I missed that. You should have colons : instead of equals signs = too.


#8

thanks, this fixed my code!