Решил. Если есть лучший способ, пишите, не стесняйтесь.
let users = [
{
name: 'user 1',
services: [
{
title: 'service 1',
categories: ['category 1', 'category 2']
},
{
title: 'service 2',
categories: ['category 3', 'category 4']
},
{
title: 'service 3',
categories: ['category 5', 'category 6', 'category 11']
}
]
},
{
name: 'user 2',
services: [
{
title: 'service 4',
categories: ['category 7', 'category 8']
},
{
title: 'service 5',
categories: ['category 9', 'category 10']
},
{
title: 'service 6',
categories: ['category 11', 'category 12']
}
]
}
];
let filterBy = ['category 5', 'category 6', 'category 11'];
let usersUPD = [];
for (let item of users) {
for (let item2 of item.services) {
if (item2.categories.some(i => filterBy.includes(i))) {
usersUPD.push(item)
}
}
}
console.log(usersUPD)