📜  查找异常值 js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:58.787000             🧑  作者: Mango

代码示例1
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];
}