ES六

来自:http://es6.ruanyifeng.com/#docs/style

1,=>

// bad
console.log([1,2,3,4].map(function(x){return x+1}))
// good
console.log([1,2,3,4].map((x)=>{return x+1;}))
// best
console.log([1,2,3,4].map(x=>x+1))

 

posted on 2017-12-04 16:06  _jackie  阅读(146)  评论(0编辑  收藏  举报

导航