Skip to content

Commit ba4ea41

Browse files
committed
edit iterator
1 parent 7b97e0a commit ba4ea41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/iterator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,11 +502,11 @@ JavaScript原有的`for...in`循环,只能获得对象的键名,不能直接
502502
```javascript
503503
var arr = ["a", "b", "c", "d"];
504504

505-
for (a in arr) {
505+
for (let a in arr) {
506506
console.log(a); // 0 1 2 3
507507
}
508508

509-
for (a of arr) {
509+
for (let a of arr) {
510510
console.log(a); // a b c d
511511
}
512512
```

0 commit comments

Comments
 (0)