filter() 方法创建一个新数组, 其包含通过所提供函数实现的测试的所有元素。

const list = [1, 2, 3, 4];
list.filter((el) => el % 2 === 0); // [2, 4]