📜  javascript 乘法参数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:49.727000             🧑  作者: Mango

代码示例2
function sum(...numbers) {
    return numbers.reduce((accumulator, current) => {
        return accumulator += current;
    });
};
 
sum(1,2) // 3
sum(1,2,3,4,5) // 15