I am new to javascript and I'm not too sure how to add json to an array. I fetching the json using the fetch command. This is my code to fetch the json file
fetch("event.json")
.then(response => response.json())
.then(json => console.log(json));
I'm not sure how to add this to an array now, any help would be greatly appreciated!
This is the json i am fetching
{
"id": "1",
"name": "Tim",
"email": "Tim@gmail.com",
"event":[{"id":1,"name":"HomeShow"}]
}
It is a large json file with multiple people. I need to fetch this file and then add it to an array so i can iterate through it and take out certain values