Issue #137. Docs for memoize.

This commit is contained in:
Jeremy Ashkenas
2011-03-20 19:05:03 -04:00
parent 866cd35236
commit d71f4808c1

View File

@@ -676,7 +676,9 @@ jQuery('#underscore_button').bind('click', buttonView.onClick);
Memoizes a given <b>function</b> by caching the computed result. Useful
for speeding up slow-running computations. If passed an optional
<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>
<pre>
var fibonacci = function(n) {