Created
April 27, 2016 07:43
-
-
Save amacneil/8e0179c40cedec5136be21e3a4586aea 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 foo() { | |
const userId = 42; | |
const user = await User.findById(userId); | |
return user.name; | |
} | |
function foo() { | |
const userId = 42; | |
return User.findById(userId).then((user) => { | |
return user.name; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment