Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getJSON = (input, init) => {
- return fetch(input, init)
- .then((response) => response.ok
- ? response
- : Promise.reject(
- new Error(`${response.status}: ${response.statusText}`)
- )
- )
- .then((response) => response.json());
- }
Add Comment
Please, Sign In to add comment