I have two arrays;
let items = {
search: [
['car', 'door', 'pen']
]
}
let data.props = [];
data.props = [
{label: "car"},
{label: "window"},
{label: "kettle"},
{label: "chair"},
{label: "door"},
]
How can I check/compare between the two arrays using es6? A little bit tricky for me since items[]
is a nested array.
What I have only checks for the first item.
if (data.props['0'].label === items.search['0'].values['0']) {
let searchItems = [];
searchItems.push(data.props['0']);
console.log(searchItems);
}