In lodash, here is an example of something short, clean, and simple that would probably take you 10 lines in regular old js.
Code:
map(myArray, partialRight(pick, ['myKey']))
What this does is iterates through myArray (which is an array of objects), grabs the property called myKey, and returns an object with only that key in it. What if you really just want to grab a single key and return it?
Code:
map(myArray, 'myKey')
Last edited by Craggoo; 01-09-2018 at 11:40 PM.