我有两个函数,将其中一个作为参数传递,例如:
var a = function(f)
{
// some code
f();
};
var b = function()
{
};
a(b); // works great, the function a is executed, then the function b is executed
现在我需要将它扩展到树函数,例如:
var a = function(f)
{
// some code
f();
};
var b = function(f)
{
// some code
f();
};
var c = function()
{
};
a(b(c)); // but it does not work. b(c) words like a method and get executed right on the instruction.
我怎样才能做到这一点?