Skip to content

Instantly share code, notes, and snippets.

@gaurang847
Last active June 19, 2019 18:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
function get_value_from_DB(){
//Database related code here.
//At the end of operation, it returns 42 if successful
//and -1 otherwise
}
let value = get_value_from_DB();
console.log(value); //prints 'undefined' as console.log runs before
//get_value_from_DB() could return a value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment