I want the user base to be able to filter by several parameters.
I have an object with parameters to filter:
const options = { _id: 'fu4gosy5hjruierbweyuu5u6hh', name: "Jhon" }
and an array of objects with a database of users:
const base = [
{ _id: '5h245jg2h4gjh2jh5g2j4hg52g', name: 'Jhon' },
{ _id: 'fdgd6fgd7f84b5hhjfdghj4hgg', name: 'Jhon' },
{ _id: 'fu4gosy5hjruierbweyuu5u6hh', name: 'Jhon' }
]
Of course you could make everything much simpler, namely to filter by unique id, but you have to understand that filtering has to be by several parameters and parameters can be completely different.
I tried using every() in filter().