Created
December 24, 2015 03:41
-
-
Save benmccormick/c65cb4d029afffc545ec to your computer and use it in GitHub Desktop.
Super Simple async-await example
This file contains 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
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