It keeps saying that I didn't save snoopy's age into age

var snoopy = new Object();
snoopy.species = "beagle";
snoopy.age = 10;

// save Snoopy's age and species into variables
// use dot notation for snoopy's species
var species = snoopy.species;
// use bracket notation for snoopy's age
var age = snoopy[age] ;


when you use the bracket notation, age has to be a string

you have two options, the dot notation, in which case you can use the property name (like you did with species) or the bracket notation in which case the property name should be a string


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