I have a question, how to get one object from an object array?
The object array looks like this:
const allData = [{
key1: "value1",
key2: "value2",
service: {
id: "123",
name: "name1"
}
},
{
key1: "value1",
key2: "value2",
service: {
id: "222",
name: "name2"
}
}
]
I want to get the object with service.id
is 222.
What should the code look like?