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

原文地址:https://www.cnblogs.com/zsqfightyourway/p/9254024.html