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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -