📜  什么是...在 javascript 代码示例中

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

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