JS โฉ async โฉ Promise โฉ getJSON()
function getJSON(url) { return fetch(url).then(response => response.json()); }
fetch() - returns Promise that resolves to the Response object
Response
Response โฉ .json() - returns Promise which resolves with the result of parsing the body text as JSON.
JSON
Promise โฉ .then() - returns Promise
Last updated 2 years ago