Skip to content

Instantly share code, notes, and snippets.

@nomanHasan
Last active September 7, 2017 20:15
Show Gist options
  • Save nomanHasan/ffdec5a720711761e551d4ae1a70ff90 to your computer and use it in GitHub Desktop.
Save nomanHasan/ffdec5a720711761e551d4ae1a70ff90 to your computer and use it in GitHub Desktop.
// Anatomy of a Async Function
exports.some_function = async function(){
try{
// await keyword pauses the execution of the function and returns the resolved value once completed
let value = await promise()
// Do Something with the Value, it will only get executed after the promise above has been resolved
}catch(exception){
// Handles exception
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment