Skip to content

Commit e7968b7

Browse files
Merge pull request #273 from geekf/patch-1
Fixing bad code example for over-optimization
2 parents b36557a + 0762d8f commit e7968b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ they are fixed if they can be.
980980
```javascript
981981
// On old browsers, each iteration with uncached `list.length` would be costly
982982
// because of `list.length` recomputation. In modern browsers, this is optimized.
983-
for (let i = 0; len = list.length; i < len; i++) {
983+
for (let i = 0, len = list.length; i < len; i++) {
984984
// ...
985985
}
986986
```

0 commit comments

Comments
 (0)