I am running into an issue, I have a similar array of Strings in JS:
const users = [
{
age: 13,
username: "adam",
interests: []
},
{
age: 20,
username: "eve"
interests: [
{
name: "Bars",
},
{
name: "Cafe",
},
],
},
{
age: 23,
username: "alex"
interests: [
{
name: "Bars",
},
{
name: "Healthy",
},
{
name: "Japanese",
},
],
},
];
const interests = ["Bars", "Cafe"];
And I would like to filter users having the same interests as the array of interests.
I tried in different ways without getting the desired result. How should I proceed with this?