for-of with `const` variable
Isiah Meadows
isiahmeadows at gmail.com
Sun Oct 18 06:09:38 UTC 2015
I was toying around with for-of loops in Node 4.0, and I ran into the
following problem:
```
$ node
> for (let i of [1, 2, 3]) console.log(i)
1
2
3
undefined
> for (const i of [1, 2, 3]) console.log(i)
1
1
1
undefined
```
That second loop is rather surprising. Is that the correct behavior
(in which I need to file an ESLint bug), or is this a V8 bug?
--
Isiah Meadows
More information about the es-discuss
mailing list