let nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let res = nums.filter((num) => { //num为循环的元素
return num > 5;
});
console.log(res); // [6, 7, 8, 9, 10]
let nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let res = nums.filter((num) => { //num为循环的元素
return num > 5;
});
console.log(res); // [6, 7, 8, 9, 10]