Arrays of Objects

In JavaScript, you will work with arrays of objects a lot. An array of objects is simply several objects stored in a single array.

let animals = [ // change to animals since there are multiple. Note array bracket notation.
    {
        name: ‘Huey’,
        age: 2
},
{
        name: ‘Louie’,
        age: 1
    }
];
console.log( animals [0].name ); // Outputs “Huey”. Note the array notation.

Happy Coding!

Clay Hess