Execute if function from typeof
Hi,
I have below code to check if passed object is a function or not.
I want to know how can I execute the function if it's a function no matter what function is passed?
- if (typeof e.itemData.onExecute === "function")
- {
- console.log("is function");
- -------- EXECUTE THE FUNCTION ---------
- }
- else
- {
- console.log("is NOT function");
- }
Thanks,