how to fetch json data using javascript fetch code example
Example 1: javascript fetch json
fetch('./yourjson.json')
.then((response) => response.json())
.then((data) => {
console.log(data);
})
Example 2: javascript how to fetch data
.catch(function() {
});