我有兩個功能,通過一則作爲參數,如:傳遞函數的參數
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.
哪有我去做?