Properties


#1


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


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


#2

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


#3

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