how to check if a javascript function is called code example Example: check if function javascript variableToCheck instanceof Function