JS newbie here. I would like to store the JSON data from an API call inside a variable in my .fetch method.
Here is my current code:
// Store database to array
let database = []
fetch('./database.json')
.then(response => response.json())
.then(data => console.log(data))
The data is being logged in the console succesfully, but I would like for them to be saved inside the database array.
Any idea how I would go about that? Thank you all so much!