how to check if an if function works js code example Example: check if function javascript variableToCheck instanceof Function