31. Properties


#1


https://www.codecademy.com/en/courses/spencer-sandbox/5/2?curriculum_id=506324b3a7dffd00020bf661#


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"];


#2

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

snoopy.species

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

same for bracket notation, you need age property


#3

Thank you! I misunderstood! Now I get it.


#4