I have a project which uses Babel to transcode ES6. What is the benefit of using lodash functions compared to writing pure JavaScript ones. For example, is it better to use map() instead of _.map() ?
Libraries like Lodash and Underscore are better for handling stuff like this, especially if your website has users with older browsers which lack browser support for features like map. But if you still want to use an inbuilt feature, I guess you could always polyfill the feature into the browser.
Matti Salokangas
UX Developer
I was curious myself and have ended up using lodash due to its cross-browser support and it simply performing better than native implementations.
I put together a jsfiddle demonstrating the use of the native
reduceandeveryfunctions vs lodash equivalents here:https://jsfiddle.net/3w3jh5xv/2/
Click run and open the console to see the time comparisons.