Jul 23, 2017 · 1 min read
As Mikhail Novikov mentioned, extracting the parse function above _.mapValues would be the next step to improvement. The current implementation creates 3 new functions for every element of the item array. Since the parse functions are not dependent from any parameter from the (k, v) pair, they can be defined before the iteration and therefore avoid recreating them x times (where x is the length of the item array).