1 var isObject = require('./isObject');
3 /** `Object#toString` result references. */
4 var funcTag = '[object Function]';
6 /** Used for native method references. */
7 var objectProto = Object.prototype;
10 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
13 var objToString = objectProto.toString;
16 * Checks if `value` is classified as a `Function` object.
21 * @param {*} value The value to check.
22 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
28 * _.isFunction(/abc/);
31 function isFunction(value) {
32 // The use of `Object#toString` avoids issues with the `typeof` operator
33 // in older versions of Chrome and Safari which return 'function' for regexes
34 // and Safari 8 which returns 'object' for typed array constructors.
35 return isObject(value) && objToString.call(value) == funcTag;
38 module.exports = isFunction;