DEV Community

Cover image for Should you use JS utility libraries or in-built methods?
Nitin Reddy
Nitin Reddy

Posted on

Should you use JS utility libraries or in-built methods?

Today I would like to talk about JS utility libraries like UnderscoreJS, Lodash, and RamdaJS. These libraries have been really good in terms of the features they provide. Often it has been seen that a developer ends up writing custom utility methods in order to fulfill the heavy object manipulations.

Alt Text

Key points to note -

  • Object manipulation
  • Array iterations
  • Creating chained functions to handle and get results.

We as developers can learn many design patterns from these libraries. I have personally found Functional programming as one of the best implementations in these libraries.

It's interesting to see how these libraries have implemented and fully utilized the design patterns of modern programming languages.

Developers usually come across problems related to functions, arrays, and objects in the day to day development.

I have been working with Lodash for the past 10 months. One thing which every programmer will understand that you need to get deeper and deeper into these libraries to understand the core part of the design patterns they implement.

I found one of the articles which explain the difference between native javascript methods and Lodash implementation of methods in a really nice way.

Important things to be observed in these libraries are chaining of methods ( Example of functional programming). The important thing to notice here is that the time complexity in terms of the execution of these methods.

JavaScript developers must explore Functional programming

Some resources that I would suggest for JS developers in general

Happy learning, stay healthy and fit!

Discussion (0)