Is there a way of doing this without altering the function?
function foo(bar1, bar2, bar3)
{
return bar1 + bar2 + bar3;
}
var array = [1, 2, 3];
console.log(foo(array)); //6
Is there a way of doing this without altering the function?
| ||||
feedback
|
| |||||||||||
feedback
|
foo(array[0], array[1], array[2]);
? – Jared Farrish Nov 24 '11 at 9:04