Files
lodash/isFunction.js
Benjamin Tan 5aaf898a8f Fix ESLint errors and tests.
I've commented out a test for `_.merge` and will re-look it as I
gradually cleanup the codebase.
2020-12-21 21:52:57 +08:00

33 lines
594 B
JavaScript

/**
* Checks if `value` is classified as a `Function` object.
*
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
* @example
*
* isFunction(class Any{})
* // => true
*
* isFunction(() => {})
* // => true
*
* isFunction(async () => {})
* // => true
*
* isFunction(function * Any() {})
* // => true
*
* isFunction(Math.round)
* // => true
*
* isFunction(/abc/)
* // => false
*/
function isFunction(value) {
return typeof value === 'function'
}
export default isFunction