how to check if a value is a function in javascript 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]';
}