1function sum(...numbers) {
2 return numbers.reduce((accumulator, current) => {
3 return accumulator += current;
4 });
5};
6
7sum(1,2) // 3
8sum(1,2,3,4,5) // 15
1function multiply(multiplier, ...theArgs) {
2 return theArgs.map(element => {
3 return multiplier * element
4 })
5}
6
7let arr = multiply(2, 1, 2, 3)
8console.log(arr) // [2, 4, 6]
9