[Vuejs]-Nested filtering of array of objects

1๐Ÿ‘

โœ…

I got it. I used .some()

this.taggedOrders = packages.filter(item => item.object_tags.some(x => x.tag.name === 'Lost'));

-1๐Ÿ‘

you are almost there, with nested filter, you need to get to the first filter condition as well.. in this case you can use condition where the length > 0. ex:

this.taggedOrders = packages.filter(p => p.object_tags.filter(t => t.tag.name === 'Lost').length > 0);

Leave a comment