Underscore.js
What is Underscore.js ?
Underscore.js is a lightweight JavaScript library and not a complete framework that was written by Jeremy Ashkenas. It provides utility functions for a variety of use cases in our day-to-day common programming tasks. Underscore.js provides a lot of features that make our task easy to work with objects. It can be used directly inside a browser and also with Node.js.

Underscore Tutorial
Why Underscore.js ?
With just under six kilobytes in size, this library basically provides us with a whole bunch of useful JavaScript functions for making our life easier. There are literally hundreds of different functions available that support both our workaday functional helpers such as the map and filter functions, as well as more specialized ones such as JavaScript templating, function binding, deep equality testing, creating quick indexes, and many more. Underscore.js functions basically falls under four major categories which are functions that can be used for manipulating arrays, functions that can be used for manipulating objects, functions that can be used for manipulating both arrays as well as objects, and functions that can be used for manipulating other functions itself.
How to Install and use Underscore.js ?
We can use Underscore.js directly inside the browser and also with node.js. We will discuss both of these methods.
Method 1: Using CDN Link
Visit the official website (https://underscorejs.org/) and download the latest underscore-min.js file UMD available. After that include the following CDN link inside your code in order to run the underscore.js code inside the browser.
Method 2: Using nmp or yarn Package Manager
We can install it with npm. Make sure that you have Node.js and npm installed.
npm install underscore
You can also install with yarn
yarn install underscore
Now let’s understand the working of code through an example.
Features of Underscore.js
- Perform common operations of data like arrays, objects, JSON files, etc.
- Compatible with other JS libraries like jQuery to perform DOM operations.
- Contains function for data manipulation.
Learn more about Underscore.js
Underscore.js Collections Methods
- Underscore.js _.each() Method
- Underscore.js _.map() Method
- Underscore.js _.reduce() Method
- Underscore.js _.reduceRight() Method
- Underscore.js _.find() Method
- Underscore.js _.filter() Method
- Underscore.js _.where() Method
- Underscore.js _.findWhere() Method
- Underscore.js _.reject() Method
- Underscore.js _.every() Method
- Underscore.js _.some() Method
- Underscore.js _.contains() Method
- Underscore.js Collections Complete Reference
- Underscore.js _.invokes() Method
- Underscore.js _.pluck() Method
- Underscore.js _.max() Method
- Underscore.js _.min() Method
- Underscore.js _.sortBy() Method
- Underscore.js _.groupBy() Method
- Underscore.js _.indexBy() Method
- Underscore.js _.countBy() Method
- Underscore.js _.shuffle() Method
- Underscore.js _.toArray() Method
- Underscore.js _.size() Method
- Underscore.js _.partition() Method
Underscore.js Array Methods
- Underscore.js _.first() Method
- Underscore.js _.initial() Method
- Underscore.js _.last() Method
- Underscore.js _.rest() Method
- Underscore.js _.compact() Method
- Underscore.js _.flatten() Method
- Underscore.js _.without() Method
- Underscore.js _.union() Method
- Underscore.js _.intersection() Method
- Underscore.js _.difference() Method
- Underscore.js Array Complete Reference
- Underscore.js _.uniq() Method
- Underscore.js _.zip() Method
- Underscore.js _.unzip() Method
- Underscore.js _.object() Method
- Underscore.js _.chunk() Method
- Underscore.js _.indexOf() Method
- Underscore.js _.lastIndexOf() Method
- Underscore.js _.sortedIndex() Method
- Underscore.js _.findIndex() Method
- Underscore.js _.findLastIndex() Method
- Underscore.js _.range() Method
Underscore.js Functions
Underscore.js Object Methods
- Underscore.js _.keys() Method
- Underscore.js _.allKeys() Method
- Underscore.js _.values() Method
- Underscore.js _.mapObject() Method
- Underscore.js _.pairs() Method
- Underscore.js _.invert() Method
- Underscore.js _.create() Method
- Underscore.js _.functions() Method
- Underscore.js _.findKey() Method
- Underscore.js _.extend() Method
- Underscore.js _.extendOwn() Method
- Underscore.js _.pick() Method
- Underscore.js _.omit() Method
- Underscore.js _.defaults() Method
- Underscore.js _.clone() Method
- Underscore.js _.tap() Method
- Underscore.js _.property() Method
- Underscore.js _.propertyOf() Method
- Underscore.js _.matcher() Method
- Underscore.js _.isEqual() Method
- Underscore.js _.isMatch() Method
- Underscore.js Objects Complete Reference
- Underscore.js _.isEmpty() Method
- Underscore.js _.isElement() Method
- Underscore.js _.isArray() Method
- Underscore.js _.isObject() Method
- Underscore.js _.isArguments() Method
- Underscore.js _.isFunction() Method
- Underscore.js _.isString() Method
- Underscore.js _.isNumber() Method
- Underscore.js _.isFinite() Method
- Underscore.js _.isBoolean() Method
- Underscore.js _.isDate() Method
- Underscore.js _.isRegExp() Method
- Underscore.js _.isError() Method
- Underscore.js _.isSymbol() Method
- Underscore.js _.isMap() Method
- Underscore.js _.isWeakMap() Method
- Underscore.js _.isSet() Method
- Underscore.js _.isWeakSet() Method
- Underscore.js _.isArrayBuffer() Method
- Underscore.js _.isNaN() Method
- Underscore.js _.isNull() Method
- Underscore.js _.isUndefined() Method
Underscore.js Utility Methods
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above

