You access an element in an array with an index starting from 0
, like you noted.
Accessing a key in an object is just a matter of using the key name:
const secondBook = books[2];
solved How to find objects by key in javascript object?
You access an element in an array with an index starting from 0
, like you noted.
Accessing a key in an object is just a matter of using the key name:
const secondBook = books[2];
solved How to find objects by key in javascript object?