1、ES5中的arguments参数
<script>
function stars(){
console.log(arguments);
console.log(arguments[0]);
}
stars("黄渤", "孙红雷", "张译")
</script>
arguments的原型是一个object
2、ES6中的rest参数
<script>
function stars(a, b, ...args){
console.log(a);
console.log(b);
console.log(args);
}
stars("黄渤", "孙红雷", "张译", "吴京")
</script>
rest参数必须要放到形参列表的最后
这里的rest参数是一个数组,我们可以利用数组的函数来进行处理参数,方便很多