Lodash get single array from nested array objects

sorry for the newbie question. Using lodash, how to get an array with all nested "machineries" entries from this API response ?

{
  "areas": [
    {
      "name": "BAR 1",
      "machineries": [
        {
          "_id": "stand BAR 1.1"
        }
      ]
    },
    {
      "name": "BAR 2",
      "machineries": [
        {
          "_id": "stand BAR 2.1"
        },
        {
          "_id": "stand BAR 2.2"
        }
      ]
    }
  ]
}

Using above data I would return 3 entries:

[
    {
        "_id": "stand BAR 1.1"
    },
    {
        "_id": "stand BAR 2.1"
    },
    {
        "_id": "stand BAR 2.2"
    }
]

Thank's

1 answer

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum