Last active
July 21, 2016 20:50
-
-
Save xjamundx/5b79acd2ab86ab1cee6173cb4d7df8a4 to your computer and use it in GitHub Desktop.
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 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