rest
Parameter variable represents an array, all the array-specific methods can be used for this variable:
function push(array, ...items) { items.forEach(function(item) { array.push(item); console.log(item); }); } let a = []; push(a, 1, 2, 3) console.log(a) //输出 [1, 2, 3]