Created
August 10, 2021 11:43
-
-
Save RoySegall/1a0496b43225c036ee61e1baa57cca80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
const response = await fetch("https://icanhazdadjoke.com/"); | |
// do something here with reponse. | |
} catch (e) { | |
// do somethign with the error. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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