Reputation: 162
I have 4 users in this example, all of them has key fbid there is stored facebookID if it matches given key user should be deleted from array. So basicaly I dont want user int this array with given facebookid.
Any help would be perfect. I tried deconstruct it like this : But dont know how to filter it now
Tried this: Object.entries(userMap).map(([key, value]) => Object.entries(value[1]).filter(value[1]['fbid'] == '315151515'))
Upvotes: 0
Views: 70
Reputation: 13693
I think you want something like this
var arr = [
[{
fbid: 111
}],
[{
fbid: 222
}],
[{
fbid: 333
}]
]
const searchedFbid=222
const result = arr.filter(x => !x.some(({
fbid
}) => fbid === searchedFbid))
console.log(result)
Upvotes: 1