Skip to content

Commit

Permalink
Merge pull request #273 from geekf/patch-1
Browse files Browse the repository at this point in the history
Fixing bad code example for over-optimization
  • Loading branch information
ryanmcdermott committed Nov 22, 2019
2 parents b36557a + 0762d8f commit e7968b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ they are fixed if they can be.
```javascript
// On old browsers, each iteration with uncached `list.length` would be costly
// because of `list.length` recomputation. In modern browsers, this is optimized.
for (let i = 0; len = list.length; i < len; i++) {
for (let i = 0, len = list.length; i < len; i++) {
// ...
}
```
Expand Down

0 comments on commit e7968b7

Please sign in to comment.