Open In App

Difference between lodash and Underscore

The lodash and UnderScore both are utility libraries from JavaScript which helps make it easier by providing utils which makes, working with arrays, numbers, objects, and strings much easier. They provide a group of tools used for common programming operations having a strong functional programming task.

Lodash: It is a JavaScript utility library that delivers consistency, modularity, and performance to its code. It provides utility functions for the basic programming tasks using the functional programming paradigm. Lodash’s API is a superset of Underscore. It provides every functionality that Underscore does, along with a few additional helpful functions such as AMD support, deep clone, and deep merge. It also provides better overall performance and optimization of larger iterables than underscore.



Underscore: Underscore is a modern JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. Underscore was created by Jeremy Ashkenas.

Differences between lodash and underscore:



Lodash Underscore
  • Lodash holds first position amongst the most depended on packages according to Node Package Manager(NPM) from javascript.
  • Underscore holds ninth position amongst the most depended on packages according to Node Package Manager(NPM) from javascript.
  • Lodash has improved syntax for chaining functions.
  • Underscore’s chaining syntax are a bit heavy.
  • Lodash is significantly larger than Underscore with a size of 33KB
  • Underscore lies at about 16KB only.
  • Lodash is fast.
  • Underscore is average in speed.
  • Lodash can handle nested objects.
  • Underscore can handle only the base objects
  • Lodash allows cloning and comparing objects that are deeply nested.
  • Underscore does not allow cloning and comparing of nested objects.

Different basic commands of lodash and underscore having same functionality:

It checks if the predicate returns TRUE for any element of the collection.

It checks if the predicate returns TRUE for all elements of the collection.

It creates a function that invokes the given functions from right to left.

It looks through the list and returns the first value that matches all of the key-value pairs listed in properties.

It returns a key for each element in the list and returns an object with an index of each item.

It calls the method named by method name on each value in the list.

It transforms the value of each property in turn.

It returns the index at which value can be found in the array, or -1 if the value is not present in the array.

It looks through each value in the list and returns an array of all the values that match the key-value pairs listed in properties.

It converts an object into a list of key-value pairs.

Article Tags :