Created
December 26, 2017 10:40
-
-
Save hoslack/7ed2e7de43a3059828b2f39caba6e48d to your computer and use it in GitHub Desktop.
Javascript Promises using async and wait
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
| const fetchquote = async ()=> { | |
| const res = await fetch('https://talaikis.com/api/quotes/random/'); | |
| const jsonObject = await res.json(); | |
| console.log(jsonObject.quote) | |
| } | |
| fetchquote(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment