Skip to content

Instantly share code, notes, and snippets.

@benmccormick
Created December 24, 2015 03:41
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 benmccormick/c65cb4d029afffc545ec to your computer and use it in GitHub Desktop.
Save benmccormick/c65cb4d029afffc545ec to your computer and use it in GitHub Desktop.
Super Simple async-await example
async function showMessageFromServer() {
let data = await fetch('/get/data.json');
let message = data.json().message;
alert(message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment