Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find outlier js

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];
}
 
PREVIOUS NEXT
Tagged: #find #outlier #js
ADD COMMENT
Topic
Name
4+4 =