Some advantages of using Lo-Dash

Lodash is a JavaScript utility library just like jQuery…


Lodash is a JavaScript utility library just like jQuery and its newest version (v3.6.0)was released just 2 days ago and it is the most depended-upon package in NPM.

Its author is John David Dalton and started it from a Underscore.js fork with the purpose to provide a more consistent cross browser behaviour with improved performance. In order to access its tools just lie jQuery uses ‘$’ to access them, in this case Lodash uses ‘_’.

Now, to install the library we can get the library from the following url:

Then we can install it in our browser using

script src=“yourpath/lodash.js

OR using nom package manager

npm i -g npm
npm i —save lodash


Code is cleaner and is easy to accomplish things with fewer lines of code. For example to make a sum of 2 numbers it is done as

below. _.add(81,2);

To get a max value from an array of integers we can use


Listing objects from a JSON object.
Suppose we have a nested JSON file. We can iterate through the file using _chain. Assume we have a json with name,surname,fullname, email fields. We can access and list all using


If we want to access and get an specific field we can do the following


This will take the first user from the array and display its email.