Skip to content
Advertisement

Collect all values in a multidimensional array with a specific key

I have an array like this:

JavaScript

How can I get all [id] values from this array and store them in a flat array like this:

JavaScript

Advertisement

Answer

$a is your original array.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement