4 ms·
> In many cases it is more performant Imho, choosing to use a library like lodash in the beginning of your project for performance reasons is a premature optimi
by stymaar 11y ago
> In many cases it is more performant
Imho, choosing to use a library like lodash in the beginning of your project for performance reasons is a premature optimisation. In 90% of the projects, the speed of Array.prototype.map compared to _.map will never be part of the performance bottleneck.
> it is often simpler to use and remember
Maybe people are used to one library's api, and expect the native counterpart to be more difficult, but the examples given in the article are counter examples to this statement.
- jdd 11y agoYou use something like lodash from the start so you know out of the gate you're getting something modular, consistent, feature rich, that also happens to perform well. Using a library like lodash gives wiggle room between you and the language. This wiggle room allows for increased consistency, added features, and performance improvements. For example ES6 introduces changes in `Object.keys` to support string values. Lodash standardizes the behavior so it's consistent across es3, es5, and es6 environments.