Today, I created my very first JavaScript object!
Liquid error: internal
var myDog = {
"name": "Cheeto",
"enemies": "Puppy the cat"
};
I was also able to access properties with dot and bracket notation
>var nameval = myDog.name; // "Cheeto"
>var enemiesval = myDog.enemies; // "Puppy the cat"
var nameValue = myDog["Name"]; // Cheeto
var enemiesValue = myDog['enemies']; // Puppy the cat
Top comments (0)