I have a checkbox that allows me to filter items according to which are selected, but the system that I am was designed for a select of only 1 value, now I am adapting it to work with arrays instead of a number.
Code
let items = this.backup.filter(p => (
p.tags == tags
));
This code is filtering the items whose array p.tags
is equal to tags, this works but only when I select a single tag, because when I select more than one logically it will not be the same and that's why it will not work.
Let's imagine that the array p.tags
has this content
p.tags = ["PHP", "Wordpress"]
And the array tags the following content
tags = ["Wordpress", "PHP"]
Already with the simple fact that they are disordered they are no longer the same and therefore this does not work.
In summary I would need something that allows me to match it to arrays that are "Like" and not "Equal", based not on the equality between the arrays but between their contents. I do not know if I explain myself well.