Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

read json file javascript

// using Promise 
fetch("my.json") 
	.then(response => response.json()) 
	.then(parsed => /* parsed contains the parsed json object */); 
 
// or if you can use async/await 
let response = await fetch("my.json"); 
let parsed = await response.json();
Source by www.quora.com #
 
PREVIOUS NEXT
Tagged: #read #json #file #javascript
ADD COMMENT
Topic
Name
7+4 =