1.函数参数默认值
function show({x=0,y=0}={}){console.log(x,y)} show()
2.函数参数默认已经定义了,不能再使用let和const去声明
function show(a=18){
let a=101; //错误
}
3.箭头函数 =>
let show = ()=> 1;
()=>return 东西
()=>{
语句
return
}
注意:
[1,2,3,4]->…[1,2,3,4]->1,2,3,4
1,2,3,4->…1,2,3,4->[1,2,3,4]
剩余参数:必须放到最后
转载于:https://juejin.im/post/5ba74c6e5188255c69780480
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/101397.html原文链接: