let Arr=[1,2,3,4,5,6,7,8];
let ne=Arr.filter(
(p,index,Arr)=>{
if(p>5){
return false
}else{
return true
}
}
)
console.log("newArr",Arr,ne)
打印结果
[1, 2, 3, 4, 5]