DEV Community

Discussion on: Why is Lodash Still Useful?

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

To avoid Object.fromEntries, there is .reduce.

arr.map(o => [o[key], o]).reduce((prev, [k, v]) => { ...prev, [k]: v }, {})

Actually, with map, filter, reduce -- you can do a lot.

It is impossible to say that you cannot do something in one-liner JavaScript, because minified JS is also a one liner.

Collapse
 
aumayeung profile image
John Au-Yeung

I agree. I think there're things like differenceWith in Lodash that are harder to implement by ourselves and not available in the standard library.