I have a nested array:

```
var arr = [
{
"id": 18,
"published": 1,
"include_inproject": 1,
"created_at": "2017-09-21 11:27:46",
"updated_at": "2018-06-18 15:35:38",
"name": "1-1 Benban Arinna Solar PV II",
"status_id": 15,
"capacity": 20,
"technology_id": 2,
"commercial_operations": "2019-03-31 00:00:00",
"commercial_operations_estemated": "Q1 2019",
"commercial_operations_end": "",
"commercial_operations_end_estemated": "",
"start_construction": "2018-06-18 00:00:00",
"project_id": 530,
"start_construction_estimated": "June 2018",
"capacity_low": "",
"capacity_high": "",
"technology": "Photovoltaic (PV)",
"country": "Egypt",
"region": "North Africa",
"fuels": "Solar",
"status": "Planned",
"ownership_type": "IPP",
"Units": [
  {
    "id": 1,
    "published": 1,
    "include_inproject": 1,
    "created_at": "2017-09-21 12:14:47",
    "updated_at": "2017-09-21 12:14:47",
    "name": "1-1 Benban Arinna Solar PV II",
    "grid_connection": "On-grid",
    "status_id": 14,
    "capacity": 20,
    "technology_id": 1,
    "commercial_operations": "1959-01-01 00:00:00",
    "commercial_operations_estemated": "1959",
    "commercial_operations_end": null,
    "commercial_operations_end_estemated": "",
    "start_construction": null,
    "project_id": 470,
    "start_construction_estimated": "",
    "capacity_low": null,
    "capacity_high": null
      }
    ]
}
]

```

The array contains multiple elements like the one above.

I want to access certain keys within the array and I can using the .map function:

```
var cols1 = arr.map(function(obj){
return obj["name"]   
})

```

This will return all values under the "Name" key in the entire first level array. 

Each array element has a child array called "Units" and I want to also access a key in this array but am having trouble doing so. I know how to navigate to it outside of a map:

arr[0].Units[0].name

However this will only retrieve the first instance of the key value, I want to map over the whole array and retrieve all the values within the "Units" array.

I have tried:

```
arr[0].Units.map(function(obj){
return obj[name]
})

```

But getting the error: Cannot call method "map" of undefined

I think the problem is mapping over the all "Units" subarray when they are not in one array to start with. I just don't know how to fix this. 
Any help would great!