This question as a JS-only answer here. But simply because I'd like to become more proficient with Lodash, I'm looking for the Lodash solution.
Let's say I have an array that looks like:
[[a, b, c], [d, e, f], [h, i, j]]
I'd like to get the first element of each array as its own array:
[a, d, h]
What is the most efficient way to do this with Lodash? Thanks.
let result = arr.map(a => a[0])let result = _.map(arr, a => a[0]);