Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to import json in js

const jsonCountry = "dist.countries.json";
fetch(jsonCountry)
    .then(Response => Response.json())
    .then(data => {
        console.log(data);
        // or whatever you wanna do with the data
    });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #import #json #js
ADD COMMENT
Topic
Name
1+5 =