ES6箭头函数

ES5写法

function add(a,b){
return a+b
}
console.log(add(1,2)); // 3
 
转换成ES6箭头函数写法
let add=(a,b)=>{
return a+b
}
console.log(add(1,2)); //3
原文地址:https://www.cnblogs.com/sunyang-001/p/10850215.html