javascript java fetch json read code example
Example 1: javascript fetch json
fetch('./yourjson.json')
.then((response) => response.json())
.then((data) => {
console.log(data);
})
Example 2: fetch json file
fetch('http://example.com/movies.json')
.then(response => response.json())
.then(data => console.log(data));