Javascript insert a method call inside another external function -
consider this
var obj = { process: function run(param) { return; } }
and
runsomething(param);
the situation run
function built elsewhere in application , contains additional processing need done runsomething
response.
is possible somehow run obj.run
, insert runsomething
it, runsomething
can use param passed in obj.run("something")
producing same result as
var obj = { process: function run(param) { return runsomething(param); } }
you can this
var obj = { process: function run(funct, param) { return funct(param); } } obj.process(runsomething, param);
Comments
Post a Comment