Categories
JavaScript

Check if Javascript function exists

Here’s a way to check to see if a function exist before calling it.

if (typeof(functionName) != "undefined") {
   functionName(); // safe to use the function 
}