Having some trouble using a variable from JSON in another function. Can someone lend a hand?
async function fetchData() {
let response = await fetch('https://run.mocky.io/v3/b9f7261a-3444-4bb7-9706-84b1b521107d');
let data = await response.json();
}
fetchData();
data.forEach((item) => {
item.forEach((nestedItem) => {
placeCharacter(nestedItem.x, nestedItem.y, "O", myGrid);
placeRandomCharacter("O", enemyGrid, enemyGridSize);
drawBreak();
});