mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2024-04-21 12:32:22 +00:00
Fixed typeError prompt
es6[Symbol.iterator] will be called, not es6.
This commit is contained in:
+1
-1
@@ -716,7 +716,7 @@ for (let e in es6) {
|
||||
for (let e of es6) {
|
||||
console.log(e);
|
||||
}
|
||||
// TypeError: es6 is not iterable
|
||||
// TypeError: es6[Symbol.iterator] is not a function
|
||||
```
|
||||
|
||||
上面代码表示,对于普通的对象,`for...in`循环可以遍历键名,`for...of`循环会报错。
|
||||
|
||||
Reference in New Issue
Block a user