I would like to write a javascript function that works something like this ...
f([["a"]], function(e){alert(e);});
f([["a"], ["b"]], function(e1,e2){alert(e1 + ":" + e2);});
f([["a", "b"], ["c"]], function(e1,e2){alert(e1 + ":" + e2);});
I can think of a recursive solution for a loop, but how do I send an “unknown” number of variables to a function?
source
share