js is function code example
Example 1: check if function javascript
variableToCheck instanceof Function
Example 2: How to create a function in javascript
function addfunc(a, b) {
return a + b;
// standard long function
}
addfunc = (a, b) => { return a + b; }
// cleaner faster way creating functions!
Example 3: isfunction javascript
function isFunction(functionToCheck) {
return functionToCheck && {}.toString.call(functionToCheck) === '[object Function]';
}