Skip to content

Commit cb58df1

Browse files
authored
Fixed typeError prompt
es6[Symbol.iterator] will be called, not es6.
1 parent c49aac1 commit cb58df1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/iterator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ for (let e in es6) {
716716
for (let e of es6) {
717717
console.log(e);
718718
}
719-
// TypeError: es6 is not iterable
719+
// TypeError: es6[Symbol.iterator] is not a function
720720
```
721721

722722
上面代码表示,对于普通的对象,`for...in`循环可以遍历键名,`for...of`循环会报错。

0 commit comments

Comments
 (0)