I want to load JSON data and store the data in js variable, how to do it?
Thanks
Develop games in your browser. Powerful, performant & highly capable.
Just write it like you would for any other web content:
const response = await fetch("file.json"); const myJson = await response.json(); console.log("Fetched JSON: ", myJson);