Skip to content

Instantly share code, notes, and snippets.

@andineck

andineck/shadow.js

Created Mar 16, 2015
Embed
What would you like to do?
variable shadowing
var a = 1;
//undefined
function showA () { var a = 2; console.log(a);}
//undefined
a
//1
showA()
//2
a
//1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment