对象数据结构默认值 只需要在结构赋值对象中直接声明并初始化(必须是在预解构对象中已初始化)
函数参数默认值
function f1(a=1, b=2, c=3) {
console.log(a,b,c);
}
f1(10, 20, 30);//10 20 30
f1(); // 1 2 3
rest
var f1 = (...a) => { //1.数组剩余运算符
//console.log(arguments); // arguments is not defined 箭头函数中没有arguments
//rest
console.log(a,..a) //para1:数组 para2:展开数组
}
f1(6,7,8,9,0);