Skip to content

Instantly share code, notes, and snippets.

@me-shaon
Created November 14, 2017 15:00
Show Gist options
  • Save me-shaon/30564da1479eade2355651c4f604c7ab to your computer and use it in GitHub Desktop.
Save me-shaon/30564da1479eade2355651c4f604c7ab to your computer and use it in GitHub Desktop.
Javascript Hoisting caveat example for medium article
function hoist() {
console.log(a); //this will show 'undefined'
var a = 10;
}
hoist();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment