Can anyone tell me what means the (...numbers) when we create funtion parasiteSum and give the parameters to the function. If anyone can explain me for what we use this syntax and why we use, thank you soo much.
function sumAllNumbers(array) {
let reducer = (currentValue, totalValue) => currentValue + totalValue;
return array.reduce(reducer);
}
function parasiteSum(...numbers) {
return sumAllNumbers(numbers);
}
parasiteSum(1, 2, 3);