I have a method defined, say abc
, which accepts a function name, say xyz
and the arguments to that function as its arguments. Now, the abc
method needs to call xyz
with the arguments received.
xyz
can be any method and could be having any number of arguments, also, xyz
cannot be using arguments keyword. rather, the arguments for the method should be passed as separate variables.
Ex: xyz
will be defined as:
var xyz = function(a,b){//code for processing a and b}
I am calling the abc
method with the first argument as the function to be invoked and rest of the arguments as arguments to be passed to the function while calling it. In abc
, I am making use of arguments keyword to access the dynamic number of arguments sent. But from there I am not sure how to call the next function with the arguments.