if (typeof yourFunctionName == 'function') {
yourFunctionName();
}
if (typeof sourceObj.someMethod === "function") {
// you are safe using the method
sourceObj.someMethod();
}
//check if myProcedure() function exists
if (typeof myProcedure === "function") {
// This function exists
}