isFunction vs typeof function vs instanceof vs wrapped typeof function (like optimized _.isFunction)Fastest: typeof function (1.8x faster)
13,205,542 ops/sec
7,603,942 ops/sec
7,395,270 ops/sec
7,264,724 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| isFunction | |
| typeof function | |
| instanceof | |
| wrapped typeof function (like optimized _.isFunction) |
| Test name | Executions per second |
|---|---|
| ✓ wrapped typeof function (like optimized _.isFunction) | 131,643,336 Ops/sec |
| typeof function | 130,899,288 Ops/sec |
| instanceof | 105,848,112 Ops/sec |
| isFunction | 42,723,464 Ops/sec |