In javascript, there is only a level scope and a global scope. you cannot create a block region and does not add special value and does not create any region.
And this is how your code ends
function foo() { var local = 1; local = 2; return local; } foo();
In ES6, you can create block level areas with Let . ES6 is not yet supported. more about this here
source share