📜  javascript传播运算符如何工作? - Javascript代码示例

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

代码示例1
var num = [2, 4, 6, 8, 10];
console.log(...num)
//expected output: 2 4 6 8 10
console.log(88, ...num, 99) 
// added extra new elements before and after the spread operator
//expected output: 88 2 4 6 8 10 99