I have the following JSON array :
{
"list": [{
"name": "Assignment",
"id": 67,
"template": 0,
"children": [{
"assignmentnumber": 1000,
"fromCountry": "Sweden",
"toCountry": "Spain",
"fromCity": "Stockholm",
"toCity": "Madrid"
}, {
"assignmentnumber": 15678,
"fromCountry": "Sweden",
"toCountry": "Germany",
"fromCity": "Stockholm",
"toCity": "Berlin"
}, {
"assignmentnumber": 10001,
"fromCountry": "Sweden",
"toCountry": "United Kingdom",
"fromCity": "Stockholm",
"toCity": "London"
}]
}, {
"name": "Valuation form",
"id": 36,
"template": 0,
"children": [15678]
}, {
"name": "Claim",
"id": 12,
"template": 0,
"children": [1000, 10001]
}]
}
I need to extract a new array from the array containing only the 'name' element. I have tried lodash but cannot figure out how to use it properly.
Anyone who can give me a clue how to do this ?