箭头函数

109 阅读1分钟

let x=function(a,b){ return a+b }

箭头函数 let x=(a,b)=>{return a+b;} 当函数语句只有一句可简写为 let x=(a,b)=>a+b 当传参只有一个时可简写为 let x=a=>a;