Consider this
var obj = {
process: function run(param) {
return;
}
}
and
runSomething(param);
The situation is that the run
function is built elsewhere in the application and contains some additional processing that need to be done to the runSomething
response.
is it possible to somehow run obj.run
and insert the runSomething
into it, so that runSomething
can use the param that was passed in as obj.run("something")
Producing the same result as
var obj = {
process: function run(param) {
return runSomething(param);
}
}
you can do this
var obj = {
process: function run(funct, param) {
return funct(param);
}
}
obj.process(runSomething, param);