Answers for "filter even numbers javascript"

0

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 ]
Posted by: Guest on January-27-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language