DEV Community


Posted on


What is Lodash and why to use?

  1. Lodash is a JavaScript library.
  2. It helps in working with arrays,strings,objects,numbers,etc.
  3. It provides us with various inbuilt functions.
  4. It uses a functional programming approach which that coding in JavaScript easier to understand because instead of writing repetitive functions, tasks can be accomplished with a single line of code.
  5. It also makes it easier to work with objects in JavaScript if they require a lot of manipulation to be done upon them.

Why Lodash?

It provides various inbuilt functions for collections, arrays, to manipulate objects, and other utility methods that we can use directly instead of writing them from scratch.

It makes it easier to iterate over the arrays, strings as well as objects. Its modular methods enable the creation of composite functions easier.

Top comments (2)

lexlohr profile image
Alex Lohr

Why shouldn't you use lodash?

  • not tree-shakable
  • full of functions that are now supported in plain JS
  • other functions mainly help to outsource complexity instead of reducing it
  • history of security issues: – being globally used makes it a known target

Alternative solutions:

biplavmz profile image

Thanks buddy for this important information

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.