Skip to content

Commit 0762d8f

Browse files
authored
Fixing bad code example for over-optimization
1 parent b36557a commit 0762d8f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)