9.Accessing Properties, Part 2


#1

I cannot tell what's wrong with my code
I get the error messages:
SyntaxError: Unexpected identifier
and
Oops, try again. There was a problem with your syntax.

// Take a look at our next example object, a dog
var dog = {
  species: "greyhound",
  weight: 60,
  age: 4
};

var species = dog["species"];
var otherDog = {
var weight =dog["weight"],
var age =dog["age"];
};

#2

var otherDog = {
var weight =dog["weight"],
var age =dog["age"];
};

You might want to leave var out of the otherDog variable and use " : " instead of " = ".


#3

Thank you, after removing "var otherDog=" it worked
I apreciate your help


#4

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