You are allowed to use free-standing blocks like this…
var something = 1;
{
var something = 2;
print("Inside: " + something);
}
print("Outside: " + something);
This is from: http://eloquentjavascript.net/chapter3.html#p3c7ae609
But what’s the point of having blocks like that? What purpose does it serve?
In ES6 there’ll be block scoped variables declared with
let, at which free-standing blocks won’t be pointless any more.