I have a script that fetches data from an API. I have 2 .then functions, one for parsing the function in a json and another for pushing the data into an array. But after that I can't loop over the values or access them whatsoever. I saw this question asked multiple times but none of the answers worked. Here s the code :
fetch(`${api_url}/${table_name}`)
.then((response) => {
return response.json();
})
.then((data) => {
for(let row of data){
response.push(row);
}
});
, where response is an empty array. So, how can I iterate through, aceess and modify the result array? Thanks in advance(Im losing my mind)