Is there a lodash function where you can create a collection from another by selecting only the specified attributes?
stats = [{a:1, b:1}, {a:2, b:2}] reducedStats = _.pick(stats, 'a');
A regular pick only works for objects, not collections.
I achieved this with
stats = stats.map(_.partialRight(_.pick, 'a'));
which is somewhat detailed.
Stephan hoyer
source share