Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

filter array of even numbers

var arr1 = [-200, -163, -26, -4, 0, 7, 76];

var evens = arr1.filter(function(x) {
   return x % 2 === 0;
})

console.log(evens);
 
PREVIOUS NEXT
Tagged: #filter #array #numbers
ADD COMMENT
Topic
Name
8+7 =