1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-29 05:42:20 +00:00

Merge pull request #457 from chvin/patch-1

Fixed typeError prompt
This commit is contained in:
Ruan YiFeng 2017-07-19 19:26:44 +08:00 committed by GitHub
commit e0cff509f5

View File

@ -716,7 +716,7 @@ for (let e in es6) {
for (let e of es6) { for (let e of es6) {
console.log(e); console.log(e);
} }
// TypeError: es6 is not iterable // TypeError: es6[Symbol.iterator] is not a function
``` ```
上面代码表示,对于普通的对象,`for...in`循环可以遍历键名,`for...of`循环会报错。 上面代码表示,对于普通的对象,`for...in`循环可以遍历键名,`for...of`循环会报错。