?
You _may_ do it even below the loop :). The nice thing, though, to do it just before the loop. And please read up on scoping in es6. Because, obviously, for (const a of items) is quite different from what i said about es5
If you only use the variable within the loop, you should declare it within the loop and use let rather than var
You might want to read about scopes and variable scoping :)
Обсуждают сегодня