Lodash best of function

_.reduce

Reduce a collection to a single value by applying a function (a reducer to all collection values)

_.keyBy

Useful to create map data structrure from arrays

_.keys

You want all the keys of an object as array? No problem _.keys!

_.invert

You have a map and want the inverse (the key becomethe value & vice versa). It is one usage of _.invert

_.includes

Useful to test if a string is in an array of strings for examples. A sort of inArray function….

_.group_by

Good to produce grouped display, you have an array on object, and it can group them by one of its properties.

Written on October 11, 2017