9. Assessing Properties, part 2! Please Help


this isnt working for some reason and i cant figure out why!

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

var species = dog["species"];
// fill in the code to save the weight and age using bracket notation
var weight = dog["weight"],
var age = dog["age"];

syntax error: unexpected token var

Replace this line with your code.


You are using a comma operator in the wrong place

Have a close look at

var weight = dog["weight"],


And why are there curly braces?


The curly-brackets-{ } are used as code-block indicators....
Have a read

As you are using

var weight = dog["weight"];
var age = dog["age"];
} //<== NO semicolon-; required

it is useless....


Thank You So Much. I Appreciate It. I was kind of confused. lol, just a simple mistake like that can mess up your entire code.


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