I have the follow json object. I am trying to filter through the data and get the socketId value where name is equal to bq89 ```name: "bq89"
const rooms = {
"room1": {
"socketId1":{
id: "123",
name: "the person name 1"
},
"socketId2":{
id: "bq89",
name: "the person name 2"
}
},
"room2": {
"socketId11":{
id: "jkl",
name: "room 2 name 1"
},
"socketId22":{
id: "lpo",
name: "room 2 name 2"
}
}
}
const socketId = rooms['room1'].filter(e=> {return e.name === 'bq89'})
console.log(socketId)
// desired output would be: socketId2