function otherfunction (arg){
function executeFunction(otherfunction){



This seems redudant , suggestions??

In this example, it is redundant. However, in other cases, you can pass another function signature to the executeFunction() function, though that seems excessive unless the function to be called may be dynamically determined due to other things. In any case, do explain what you are trying to accomplish. In the C/C++ and other languages, this is called passing a function pointer to execute in the called function's body, perhaps using variables that the called function has, or knows about, or was passed when called.

Just a note: the function 'executeFunction' is not executing anything. In your code, the argument recieved as otherFunction in the executeFunction will be the return of execution of the defined function otherFunction.

Member Avatar


What exactly are you trying to achieve?