I've written some code that fetches json data from a url and inside of it, I push it's data into an array. Then I try to console.log the array, and I'm able to extend the brackets to see the json data inside but I'm not able to actually access the data. How could I do this? Here is my code,
let playerList = [];
fetch("https://dog.ceo/api/breeds/image/random")
.then((response) => response.json())
.then((data) => {
playerList.push(data)
});
console.log(playerList);