Question about searching values from array into another array. Example of arrays:
items = [{"name":"Goran", "category":[0:3, 1:5]}, {"name":"Marko", "category":[0:5, 1:4]}]
arr1 = ["5", "4", "3"]
Typescript try:
let result = items.filter(item => arr1.find(f => f == items.category))
and the result is none. Can you give me hint how can I do this in one line of code. Basically this is filter from template. I you can image an array of checkbox checking the values from json object. So I want to find values where from arr1 in object items.
categorysupposed to be an array of numbers? And if so, do you want ANY item inarr1to be in thecategoryarray? Or for them to contain the same items?