From cb58df14fc72bc9c66ff73db0186fec802068430 Mon Sep 17 00:00:00 2001 From: Chvin Date: Wed, 19 Jul 2017 15:27:35 +0800 Subject: [PATCH] Fixed typeError prompt es6[Symbol.iterator] will be called, not es6. --- docs/iterator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/iterator.md b/docs/iterator.md index 746032f..7a9b08a 100644 --- a/docs/iterator.md +++ b/docs/iterator.md @@ -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`循环会报错。