搜索文档
Appearance
形参初始值,一般靠后
function add(a,b,c=10){ console.log(a + b + c); }; add(1,2); // 打印 13
结合结构赋值
function test({ name,age,sex='男' }){ console.log(name,age,sex); // 打印: 张三 21 男 }; test({ name: '张三', age: 21 });