es6 箭头函数 map、find

var  value = arr.map(function (x) {return x * x});
const arr = [1,2,3,4];
const value = arr.map(x => x * x);
//value = {[[1,1],[2,4],[3,9],[4,16]]}
 
nationArr = [{'id':1,'name':'汉族'},...]
this.nationArr.find(n => n.name === '汉族').id = 1

posted @ 2018-07-02 15:27  walle1314  阅读(3712)  评论(0编辑  收藏  举报