There are two things here:
- Parentheses -
typeof is an operator, not a function, don't use them - Comparison with
'function' or typeof Function (which will always return 'function' if someone does not spin and overwrite their own objects). Use a string, it requires less work and is not subject to the aforementioned screwing.
i.e. Using:
typeof methodName === 'function'
source share