I have an array of nested objects. I am trying to iterate though the array and get back a list of ids from the nested objects.
"group": [
{
"groupId": "1",
"subGroup": {
"id": "44",
"name": "Testing",
}
},
{
"groupId": "2",
"subGroup": {
"id": "45",
"name": "Testing",
}
},
{
"groupId": "3",
"subGroup": {
"id": "46",
"name": "Testing",
}
}
]
I am trying to return a list of ids like so => [44, 45, 46]
I tried const result = map(path("subGroup", "id"), group), but it did not produce the result I need.