Skip to main content
Improve answer by giving more details about the technique.
Source Link

In ES6 youYou can do so in ES6 with the help of the spread operator:

console.log(...iterablemyArray);

At the time of this writing, this feature is supported by FF37 and transpilers such as Traceur and Babel.

Another way of doing it would be by currying the function and looping to pass the arguments. Something along the lines of:

myArray.forEach(curriedConsoleLog);

That said, I don't see harm in just using apply.

In ES6 you can:

console.log(...iterable);

You can do so in ES6 with the help of the spread operator:

console.log(...myArray);

At the time of this writing, this feature is supported by FF37 and transpilers such as Traceur and Babel.

Another way of doing it would be by currying the function and looping to pass the arguments. Something along the lines of:

myArray.forEach(curriedConsoleLog);

That said, I don't see harm in just using apply.

Source Link

In ES6 you can:

console.log(...iterable);