js test if value is a function code example
Example 1: check if function javascript
variableToCheck instanceof Function
Example 2: isfunction javascript
function isFunction(functionToCheck) {
return functionToCheck && {}.toString.call(functionToCheck) === '[object Function]';
}