Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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))
 
PREVIOUS NEXT
Tagged: #object #js
ADD COMMENT
Topic
Name
4+8 =