The lodash _.reduce method and Array.reduce.
For todays post on lodash I thought I should write a post on the _.reduce collection method, and also of course the corresponding Array.reduce method in core javaScript itself. Speaking of the native array reduce method I have now wrote a post on the native array reduce method also, but I will be touching base on that method on this post also.
The Array.reduce method works just fine, however if you are using lodash in a project the _.reduce method is a little more robust, as it is one of the many lodash collection methods that will work on arrays and many object collections in general and it also has some baked in shorthands for cretin common use case examples of it also. In any case the two solutions work very similar, and this post should help gain some insight as to why reduce is useful in some situations that call for it.