Functions and Methods

Call a Function Dynamically

window[varClassName][varFunctionName]( params );
var returned = window[varClassName][varSubClassName][varFunctionName]( params );

Is Defined

// Test if a simple function is defined.
if (typeof myFunctionName === "function")
{
    console.log( myFunctionName + ' exists!');
}

// Test if a function within a class/subclass is defined.
if (typeof window[class_name][sub_class_name][method_name] === "function")
{
    console.log( 'Class function exists!');
}