You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a comment, document the nonobvious behavior of _.identity in this context.
I wrote this comment to accompany the following sentence from [the current docs for `_.memoize`](http://documentcloud.github.io/underscore/#memoize):
> The default **hashFunction** just uses the first argument to the memoized function as the key.
I looked in the code, but couldn’t see how that was the case. The code quoted in [Issue jashkenas#137](jashkenas#137) was no longer there. I wondered if that sentence in the documentation was out-of-date. It took me a while to notice that the use of `apply` over `call` changed `_.identity` from returning `arguments` to returning the first argument.
After playing around with _.memoize, I see that the default hash function is
It would be cool if the docs mentioned this.
I'll send a pull request when I have a moment to fork+edit.
Thanks for making a super useful library!
-David
The text was updated successfully, but these errors were encountered: