I am just getting my head around lodash, so the answer to this question is probably straightforward.
Say I have the following array:
var arr = [{ a: 2, b: 3, c: 4 }, { a: 1, b: 4, c: 2 }]; I'd like to rename some keys (for all objects) and drop another, to give the following new array:
var newArr = [{ x: 2, y: 4 }, { x: 1, y: 2 }]; So, that's renaming a, c to x, y, and dropping b.
What's the neatest way to do this with lodash? I think that mapKeys should be employed but that requires an object as input rather than a collection.
This is a similar problem to that posted at lodash multidimensional pluck.
_.map()and in that callback do a_.mapkeys().