I have json data and I want to get a specific object from the data. When I print data._embedded.artworks[0]._links.thumbnail in the console, I'm able to get the first thumbnail.
I'm wondering how I get all of the thumbnails. I tried
for (var key in data) {
console.log(data._embedded.artworks[0]._links.thumbnail);
}
But here I also just get the thumbnails from the first id. I tried artworks[key] but I was not able to access other methods of the json data such as _links.
How would I loop through the json data to pull out all of the thumbnails?
data._embedded.artworks.map(link => console.log(link.thumbnail)).forEachis better so this, as you are not actuallymapping