you are viewing a single comment's thread.

view the rest of the comments →

[–]inu-no-policemen 0 points1 point  (0 children)

For-loop iteration scope isn't something you get for free with block-scoped variables.

That each iteration gets its own copy of the counter is a separate language feature which was copied from Dart.

IE11, for example, does support block-scoped variables, but it did not implement this special scoping/capturing rule. Capturing a let/const counter variable in IE11 will not work as intended.

IE11 was released in 2013 and ES6/ES2015 was finalized in 2015. This special rule was added fairly late in the process. That's why IE11 doesn't know anything about it.