Closed odv closed 4 years ago
function loadJson(url) { return fetch(url) .then(response => { if (response.status == 200) { return response.json(); } else { throw new Error(response.status); } }) }
async function loadJson(url) { let response = await fetch(url); if (response.status == 200) { return response.json(); } else { throw new Error(response.status); } }