Vote count:
0
Why example code with two variable names in for..of loop does not work? Is it so because ECMAScript 6 is still in beta mode?
Here is the code:
let arr = ['foo', 'bar', 'baz'];
for (let [index,element] of arr.entries()) {
console.log(index + '. ' + element);
}
The error:
Uncaught SyntaxError: Unexpected identifier ('[', of course)
My browser: Google Chrome 39.0.2171.65 (64-bit)
asked 38 secs ago
Why example code with two variable names in for..of loop does not work?
Aucun commentaire:
Enregistrer un commentaire