1 year ago

#71708

test-img

Enlico

pack and unpack to switch from function taking array of argumento to variadic function and viceversa

I've just been wandering why lodash/fp doesn't have these two functions:

unpack = f => x => f(...x)
pack = f => (...x) => f(x)

I'm borrowing the name unpack from the function boost::hana::unpack provided by the C++ library Boost.Hana.

In my C++ programming experience, I've used unpack a gazillion times, so I was wandering how comes nobody needs it in JavaScript.

Or maybe Lodash has such a function and I just can't guess the name?

javascript

functional-programming

lodash

variadic-functions

0 Answers

Your Answer

Accepted video resources