Rest parameters can be used to allow any number of parameters to be passed to a function.
Functional programming works better with known and explicit parameters. Having an undefined number of parameters does not work well with currying.
function sum(...numbers) {
return numbers.reduce((a, b) => a + b);
}
sum(1, 2, 3);
function sum(numbers) {
return numbers.reduce((a, b) => a + b);
}
sum([1, 2, 3]);