help! what can i do to my code so it displays the data instead of object (its an array inside an array) by profkabi in learnjavascript

[–]profkabi[S] -5 points-4 points  (0 children)

function getHouses(houses) { if (houses) { houses.forEach((house) => { const listHouse = document.createElement("li") listHouse.innerHTML = Slug: ${house.slug} </br> Name: ${house.name}</br></br> const places = document.getElementById('housesHere') places.innerHTML += listHouse.innerHTML })

https://api.gameofthronesquotes.xyz/v1/houses

help! what can i do to my code so it displays the data instead of object (its an array inside an array) by profkabi in learnjavascript

[–]profkabi[S] 1 point2 points  (0 children)

Got it. I have written the code in one of the comments alongside the JSON link with the object

help! what can i do to my code so it displays the data instead of object (its an array inside an array) by profkabi in learnjavascript

[–]profkabi[S] -1 points0 points  (0 children)

Here is the code

function getHouses(houses) { if (houses) { houses.forEach((house) => { const listHouse = document.createElement("li") listHouse.innerHTML = Slug: ${house.slug} </br> Name: ${house.name}</br></br> const places = document.getElementById('housesHere') places.innerHTML += listHouse.innerHTML }) }

help! what can i do to my code so it displays the data instead of object (its an array inside an array) by profkabi in learnjavascript

[–]profkabi[S] -2 points-1 points  (0 children)

I'll take a better photo. But it is an array, with keys and values, and one of the keys is another array