JavaScript concept with a cup of coffee and a laptop

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

Share this post

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on pinterest
Share on print
Share on email
Skip to content