From aa0a464f297311ff4b779daab942b1fcefb8c64b Mon Sep 17 00:00:00 2001 From: mg-chao Date: Thu, 6 Jan 2022 21:11:33 +0800 Subject: [PATCH] fix: JS for loop code example --- book/contents/advance/functional-programing/iterator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/contents/advance/functional-programing/iterator.md b/book/contents/advance/functional-programing/iterator.md index 209bd5dd..f17caeb0 100644 --- a/book/contents/advance/functional-programing/iterator.md +++ b/book/contents/advance/functional-programing/iterator.md @@ -9,7 +9,7 @@ 例如以下的JS代码就是一个循环: ```javascript let arr = [1, 2, 3]; -for i = 0; i < arr.length() - 1; i ++ { +for (let i = 0; i < arr.length; i++) { console.log(arr[i]); } ```