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