Skip to content

Instantly share code, notes, and snippets.

@RoySegall
Created August 10, 2021 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RoySegall/1a0496b43225c036ee61e1baa57cca80 to your computer and use it in GitHub Desktop.
Save RoySegall/1a0496b43225c036ee61e1baa57cca80 to your computer and use it in GitHub Desktop.
try {
const response = await fetch("https://icanhazdadjoke.com/");
// do something here with reponse.
} catch (e) {
// do somethign with the error.
}
new Promise(fetch("https://icanhazdadjoke.com/"))
.then((response => {
// do something here with reponse.
})
.catch(e => {
// do somethign with the error.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment