11/13


#1

Unexpected token {

// 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
};


#2

Seems your equal sign has run away! put it back in! :smiley:


#3

i thought literal notation didn't use them. I tried putting one after snoopy, didn't work?


#4

Well I get your error when I get rid of the equal sign in my code so I believe it is necessary. However, I think I see another problem.

So for your second one you don't need { } you just need a ; after new Object()


#5

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