mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
34 lines
599 B
JavaScript
34 lines
599 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
|