DEV Community

Discussion on: Passing Arrays as Function Arguments

Collapse
 
moopet profile image
Ben Sinclair

TIL function.prototype.apply(). I was looking at your "old way" and thinking, what is she talking about? :)

I guess in Javascript whenever I've wanted to pass in an array it's always been to a function that accepts arrays. I've seen people talk about the spread operator but for functions I'd expect the need to be the other way around (as with C-like functions like printf(), where you'd probably never want to convert an array to a series of parameters)