=>
是es6语法中的arrow function
(x) => x + 6
相当于
function(x){
return x + 6;
};
var ids = this.sels.map(item => item.id).join()
var ids = this.sels.map(function(item,index){
return item.id
});
=>
是es6语法中的arrow function
(x) => x + 6
相当于
function(x){
return x + 6;
};
var ids = this.sels.map(item => item.id).join()
var ids = this.sels.map(function(item,index){
return item.id
});
转载于:https://www.cnblogs.com/websmile/p/8205727.html