I want to read the json data from url, put it in an empty array, put it in a react component, and print it out. However, if you put the json data in the result array and output it as console.log, only the empty array is output. Is it wrong to push the array?
Also, I want to repeat this url 100 times and print it out in the order of many counts. For example, count: 15 {Json content}. Thank you.
let result = [];
fetch("http:// ~ ").then(res => { return res.json()}).then(data => result.push(data)).then(()=>console.log(result));