Reputation: 13270
I have this function,
function foo (foo1, foo2) {
...
}
I need to pass it as an argument of another function :
caller(foo);
how is the most proper way to pass the arguments of foo in the caller
function ?
Upvotes: 0
Views: 51
Reputation: 1040
Did you try something like this?
function internalMethod(a, b) {
console.log(a);
console.log(b);
}
function externalMethod (method) {
method (arguments[1], arguments[2]);
}
externalMethod (internalMethod, "First argument", "Second argument");
Hope it help.
Upvotes: 1