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