I saw the following code in this Github’s link:
isFunction(value) {
return !!(value && value.constructor && value.call && value.apply);
}
And wondered why it has to be such long while we can simply use typeof value === 'function'
. So, is there any difference or useful purpose of using the above code compared to the typeof
check?