Is it possible to call a JavaScript function using an array of values as arguments ?
- by Moshe Levine
I'm looking for another way of doing the following:
function call_any_function(func, parameters){
// func => any given function
if(parameters.length==0){ func(); }
if(parameters.length==1){ func(parameters[0]); }
if(parameters.length==2){ func(parameters[0], parameters[1]); }
if(parameters.length==3){…