| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Errors/Invalid_for-of_initializer | [Back] [Original] |
Get to know MDN better
JavaScript "a declaration in the head of a for-of loop can't have an initializer" for...of |for (var i = 0 of iterable)| for-of
SyntaxError: for-of loop head declarations cannot have an initializer (Edge)
SyntaxError: a declaration in the head of a for-of loop can't have an initializer (Firefox)
SyntaxError: for-of loop variable declaration may not have an initializer. (Chrome)
SyntaxError
for...of |for (var i = 0 of iterable)| for-of for
for-of let iterable = [10, 20, 30];
for (let value = 50 of iterable) {
console.log(value);
}
// SyntaxError: a declaration in the head of a for-of loop can't
// have an initializer
for-of for-of (value = 50) 50 50
let iterable = [10, 20, 30];
for (let value of iterable) {
value += 50;
console.log(value);
}
// 60
// 70
// 80
| Web Proxy Viewer | New URL | Original Page |