Skip to content

Instantly share code, notes, and snippets.

@hoslack
Created December 26, 2017 10:40
Show Gist options
  • Select an option

  • Save hoslack/7ed2e7de43a3059828b2f39caba6e48d to your computer and use it in GitHub Desktop.

Select an option

Save hoslack/7ed2e7de43a3059828b2f39caba6e48d to your computer and use it in GitHub Desktop.
Javascript Promises using async and wait
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