Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

filter even numbers javascript

var arr = [-200, -163, -26, -4, 0, 7, 76];
var evens = arr.filter(x => x % 2 === 0);

// Array(5) [ -200, -26, -4, 0, 76 ]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #filter #numbers #javascript
ADD COMMENT
Topic
Name
4+1 =