(a =>)在下面的上下文中做了什么?
function findOutlier(int){
var even = int.filter(a=>a%2==0);
var odd = int.filter(a=>a%2!==0);
return even.length==1? even[0] : odd[0];
}
答案 0 :(得分:0)
这些被称为胖箭头功能。在这种情况下,它与
相同string
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions