Skip to content

Instantly share code, notes, and snippets.

@amacneil
Created April 27, 2016 07:43
Show Gist options
  • Save amacneil/8e0179c40cedec5136be21e3a4586aea to your computer and use it in GitHub Desktop.
Save amacneil/8e0179c40cedec5136be21e3a4586aea to your computer and use it in GitHub Desktop.
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