es6 map和箭头函数

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
 

猜你喜欢

转载自www.cnblogs.com/zsqfightyourway/p/9254024.html