I can't figure it out how to set a filter that compares an array of objects with an array. I don't even know if it is possible. Here is a bit of the data and what I'm attempting to do:
The filters come from a number of checkboxes in my ui. Below and example:
the strings are characteristics and the number is the height.
const filter = ["moto", "gre", "sm"]
const arrayOfData = [{id: 1, characteristics: ['motorbike', 'green', 'small'],
}, {id: 2, characteristics: ['car', 'large', 'black']}, {id: 3, characteristics: ['motorbike', 'yellow', 'large']]
The result should throw those which arrays contain the initial letter, in the case above. I have tried using some() and include() but I can't work it out!
arr.find(item=>loop_through_its_content_and_check_it_match_the_prefix(filter,item.char))