Often it is a best practice to call function only if exists..
So this can be achieved calling our required function in:
function fExist(f){
if(typeof f == "function"){
return f();
}
}
Test:function foo(){
console.log("I am a function");
}
fExist(foo);
Result wil be:TRUE because we have defined function "foo"...