var items=[
{ message: 'Foo',name: 'sss' },
{ message: 'Bar' , name: 'aaa'}
]
items.push({ message: 'Baz' , name:'djsaj'})
console.log(items)
var newArr = items.filter(function (item) {
return item.message.match(/Foo/)
})
console.log(newArr)//0: {message: "Foo", name: "sss"}
console.log(items)
去除数组对象中的某一个对象
最新推荐文章于 2024-07-16 21:11:58 发布