-
[JavaScript] Check if a function Exists or Not
If you want to check if a function exists or not before calling, here’s how to do it if(typeof window.functionName == ‘function’) { functionName (arg1, arg2); } It returns a boolean value indicating if the function exists or not.