javascript get object where
myArray = [{'id':'73','foo':'bar'},{'id':'45','foo':'bar'}, etc.] myArray.find(x => x.id === '45').foo;
Source: stackoverflow.com
how to get in an object js
let planets = { "count": 60, "next": "https://swapi.dev/api/planets/?page=2", "previous": null, "results": [ { "name": "Tatooine" }, { "name": "Alderaan" } ] } console.log((planets[Object.keys(planets)[3]][0].name))