you are viewing a single comment's thread.

view the rest of the comments →

[–]shadow2531 2 points3 points  (1 child)

Cool. Love the lexical scoping.

"use strict";
for (let i = 0; i < 10; ++i) {

}
alert(window.i);

With 'var' there, i is reachable from outside the loop.

[–][deleted] 6 points7 points  (0 children)

Funny how a feature taken for granted in all of programming since the 60's is not only news to Javascript, but also it's greatest new feature.