欢迎来到博客园~~~

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
posted @ 2019-05-11 21:47  孙~洋  阅读(116)  评论(0编辑  收藏  举报