将数组中不符合规定的项删除,使用filter
let arr = [ {id:1,value:2}, {id:2,value:3}, {id:8,value:9} ] const newArr = arr.filter(obj=>obj.id!==8)
将数组中不符合规定的项删除,使用filter
let arr = [ {id:1,value:2}, {id:2,value:3}, {id:8,value:9} ] const newArr = arr.filter(obj=>obj.id!==8)