Skip to content

Commit

Permalink
added length cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Oct 5, 2015
1 parent d7db10c commit 9e79a59
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ Use `.test` if you want a faster boolean check. Use `.match` to retrieve all mat

* [Perfomance test](http://jsperf.com/test-vs-match-regex)


## Collections

#### create a cache variable for the length of a collection for successive `.length` calls

Prevent re-calculate the length of a collection all the time. Instead, store the value in a variable.

* [Perfomance test](https://jsperf.com/array-length-vs-cached)

# License

MIT © [Kiko Beats](http://kikobeats.com)
MIT © [Kiko Beats](http://kikobeats.com)

0 comments on commit 9e79a59

Please sign in to comment.