JS ⟩ async ⟩ Promise ⟩ getJSON()
function getJSON(url) { return fetch(url).then(response => response.json()); }
fetch()arrow-up-right - returns Promise that resolves to the Responsearrow-up-right object
Response
Responsearrow-up-right ⟩ .json()arrow-up-right - returns Promise which resolves with the result of parsing the body text as JSONarrow-up-right.
JSON
Promisearrow-up-right ⟩ .then()arrow-up-right - returns Promise
Last updated 3 years ago