documentcloud/underscore — pull request #516 by octatone (2012-03-21 03:21:30+00:00)
Title: Enhancement: use typeof where testing for function callable - inspired by issue #504

This enhancement favors unary `typeof` over the `_.isFunction` alias to `toString.call` for performance gains where checking for callable functions.

Performance testing:

* [jsperf comparison of methods for testing for functions](http://jsperf.com/toarray-function-check)
* A few comparisons using underscore test cases:
* http://jsperf.com/invoke-typeof
* http://jsperf.com/groupby-typeof
* http://jsperf.com/functions-typeof

[Changes pass underscore tests on environments I have access to](http://raymondmayjr.com/underscore/test/test.html).

Please test on edge case environments I may not have access to or may not know about before merging.