I was at jQueryUK today, and one of the things coming up in EMCAScript 6 is the concept of "let"
One of the interesting things I found was this allows scoping like var, but *within code blocks*, like "if" statements.
i.e, in pseudocode:
function foo(){
var a = 5;
var b = 10;
if (a === 5) {
let a = 4; // The scope is inside the if-block
var b = 1; // The scope is inside the function
writeDump(a); // 4
writeDump(b); // 1
}
writeDump(a); // 5
writeDump(b); // 1
}
To me, this has some interesting advantages, especially inside loops and conditional statement blocks (think counters, or indeed any variable you wish to remain private to *that* piece of code etc).
I'm assuming this isn't currently possibly in lucee.
Good thing or not? Thoughts?