3 ms·
The block which is long enough to need block scope is long enough to be a function. Special bonus to couple decomposing assignment with IIFE so that any variab
by Roboprog 10y ago
The block which is long enough to need block scope is long enough to be a function.
Special bonus to couple decomposing assignment with IIFE so that any variables/symbols which "escape" from the nested function are explicit (and the locals simply disappear with the nested function).
Const would be nice, if it went further - treating the const declared identifier as if it were deeply frozen, at least within the scope of the const identifier. Alas, that touches on what is wrong with most programming languages in common use today: mutable by default, but we should be requiring "groveling" to make something mutable.