The is package provides function detection in is.fn().
/**
* is.fn / is.function (deprecated)
* Test if `value` is a function.
*
* @param {*} value value to test
* @return {Boolean} true if `value` is a function, false otherwise
* @api public
*/
is.fn = is['function'] = function (value) {
var isAlert = typeof window !== 'undefined' && value === window.alert;
if (isAlert) {
return true;
}
var str = toStr.call(value);
return str === '[object Function]' || str === '[object GeneratorFunction]' || str === '[object AsyncFunction]';
};
The is package provides function detection in is.fn().