Skip to content
Advertisement

how to filter based on two values from the array of array

I have a bunch array of objects with participants and messages, I want to filter the object with the below array of two participants, can anyone help with this

this is the example participnats of array :

["61badffe4ccf060b329441e0","61bc33a84ccf060b32944354"]

bunch of sample messages and participants :

JavaScript

Advertisement

Answer

You might wanna use Array.filter() and also in your case you should check every element from that array which should match your criteria.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement