es5
function show(){
//console.log(arguments);
arguments.push(5);
console.log(arguments);
}
show(1,2,3,4);
es6 真正的数组
function show(...args){
args.push(5);
console.log(args);
}
show(1,2,3,4);
----------------------------------------
//箭头函数也可用
var show= (...args)=>{
args.push(5);
console.log(args);
}
show(1,2,3,4);