I've attempted various solutions for this issue and have searched around but I'm unable to get it to work.
I am dealing with 2 arrays and need to verify if any of the items in one array contain any of the strings from the other array.
const stepsShown = ["ref2", "ref7"];
const items = [
{ name: "item1", element: "ref1"},
{ name: "item2", element: "ref2"}
];
const refsExist = items.some((r) =>{stepsShown.indexOf(r.element);});
Based on this scenario, I anticipate refsExist
to be true
I might be confused with my syntax! Can someone offer assistance please? :)