1👍
✅
const expected_id = SearchedSkills[0].id
let filtered_users = []
for (const user of Users) {
if (user.id === expected_id)
filtered_users.push(user)
}
console.log(filtered_users)
1👍
You can use Array#some
.
return this.user.filter(user => this.skills.some(
skill => user.skills.some(({id}) => id === skill.id)));
Source:stackexchange.com