I’m confused. I don’t see how the
[0, 1, 2, 3, 4] magic can happen without creating two scopes, one for the
for header, in which
i++ can run, and one for the loop body, which on each run re-binds the current value of
i from the loop header, and shadows it (an implicit
let i=i, if that were syntactically valid).
I had an admittedly quick look at the specification, and it didn’t enlighten me. The way I read it, I would say the behavior Nathan reports that IE exhibits, is the behavior according to the spec. I would be happy if somebody could explain this. Where are the special rules around