I want to do a check whether a function exist or not before trying to run it. Here is my code:
if ($.isFunction(myfunc())) {
console.log("function exist, run it!!!");
}
However, when the function is not available I got the error:
myfunc is not defined
How can I do the detection? Here is my working test: http://jsfiddle.net/3m3Y3/