JavaScirpt fetch API
Usage
fetchの返り値は、Promiseオブジェクト
async function fetchJson() {
try {
const rs = await fetch('example.json');
const data = await rs.json();
} catch (e) {
console.log(e);
}
}
fetchの返り値は、Promiseオブジェクト
async function fetchJson() {
try {
const rs = await fetch('example.json');
const data = await rs.json();
} catch (e) {
console.log(e);
}
}