Skip to content

Instantly share code, notes, and snippets.

@xjamundx
Last active July 21, 2016 20:50
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 xjamundx/5b79acd2ab86ab1cee6173cb4d7df8a4 to your computer and use it in GitHub Desktop.
Save xjamundx/5b79acd2ab86ab1cee6173cb4d7df8a4 to your computer and use it in GitHub Desktop.
// async function to show user data
async function displayUserData() {
let me = await fetch('/users/me')
console.log(me)
}
// promise-based equivalent
function displayUserData() {
return fetch('/users/me').then(function(me) {
console.log(me)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment