Home » Javascript » basic javascript check on array of objects [on hold]

basic javascript check on array of objects [on hold]

Posted by: admin August 19, 2018 Leave a comment

Questions:

I have list of objects :

tags :[ {item: "#home", active: "true"},
 {item: "#garden", active: "true"},
 {item: "#edible", active: "true"},

]


items : [ 
  { title : "fan", tags:["#engine","#home"]},
  { title : "car", tags:["#heavy","#engine"]},
  { title : "bed", tags:["#home","#wood"]}
]

In javscript I am trying to iterate over each of the Item and find out if any of the tags exist in the tags object array.

what is the best way to do it ?

Answers: