31. Properties



Hi guys, I know this is a stupid question, but...I've been looking on it for a day, but I'm still stuck in it and I don't know what's the problem. Any one can take a look and a little tip for me please?
Many thanks.

When I run the code, it will say: Oops, try again. It looks like you didn't save snoopy's species into species .

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.beagle;
// use bracket notation for snoopy's age
var age = snoopy["10"];


you want to retrieve the value using dot notation, which means you need:


the object name (snoopy) and the property name (species) to get the value (beagle)

same for bracket notation, you need age property


Thank you! I misunderstood! Now I get it.