Skip to content

Instantly share code, notes, and snippets.

@fuchao2012
Created May 21, 2015 07:02
  • 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
Save fuchao2012/fedf25e7248e73920dce to your computer and use it in GitHub Desktop.
var f=true;
if(f === true){
var a = 10;
}
function fuchao(){
var b=20;
c=30;
}
fn();
console.log(a);
console.log(b);
console.log(c);
//can you tell the result?
// ONLY variables definde by "var" and most improtantly defined in "function", it is local variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment