mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Issue #137. Docs for memoize.
This commit is contained in:
@@ -676,7 +676,9 @@ jQuery('#underscore_button').bind('click', buttonView.onClick);
|
|||||||
Memoizes a given <b>function</b> by caching the computed result. Useful
|
Memoizes a given <b>function</b> by caching the computed result. Useful
|
||||||
for speeding up slow-running computations. If passed an optional
|
for speeding up slow-running computations. If passed an optional
|
||||||
<b>hashFunction</b>, it will be used to compute the hash key for storing
|
<b>hashFunction</b>, it will be used to compute the hash key for storing
|
||||||
the result, based on the arguments to the original function.
|
the result, based on the arguments to the original function. The default
|
||||||
|
<b>hashFunction</b> just uses the first argument to the memoized function
|
||||||
|
as the key.
|
||||||
</p>
|
</p>
|
||||||
<pre>
|
<pre>
|
||||||
var fibonacci = function(n) {
|
var fibonacci = function(n) {
|
||||||
|
|||||||
Reference in New Issue
Block a user