📜  过滤偶数javascript代码示例

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

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

// Array(5) [ -200, -26, -4, 0, 76 ]