Properties


#1

`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 = new Object();
snoopy.species = "beagle";
// use bracket notation for snoopy's age
var age = new Object();
snoopy['age'] = 10;`
@mtf @amanuel2 @albionsrefuge
It says It looks like you didn't save snoopy's species into species

HELP!!!!!!!!!!!!!!!!!!!!!!!!!


#2

You declare the variables with snoopy's values, not as seperate objects. Move up the lines where you call Snoopy's age and species, and remove the object declaration.


#3

`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

snoopy.species = "beagle";
// use bracket notation for snoopy's age

snoopy['age'] = 10;`
New code and still the same problem


#4

I want to save my name to a variable. Example:

var person = {
    name: "Cade"
}

name = person.name

console.log(name)

This would output:

Cade


#5

Then how for the Bracket Notation


#6

name = person["name"]


#7

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

snoopy.species = species;
// use bracket notation for snoopy's age

snoopy['age'] = age;