Underscore.js Last Updated : 23 Jul, 2025 Comments Improve Suggest changes 1 Likes Like Report 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 TutorialWhy Underscore.js? With just under six kilobytes in size, this library provides us with many useful JavaScript functions for making our lives easier. There are 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 fall 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 themselves. 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 Include the following CDN link inside your code in order to run the underscore.js code inside the browser. https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.6/underscore-min.js 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 underscoreYou can also install with yarn yarn install underscoreNow 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 Collection Methods Underscore.js Array Methods Underscore.js Functions Underscore.js Object Methods Underscore.js Utility Methods 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 _.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 Collections Complete Reference 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 _.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 Array Complete Reference Underscore.js Functions Underscore.js _.bind() Method Underscore.js _.bindAll() Method Underscore.js _.partial() Method Underscore.js _.memoize() Method Underscore.js _.delay() Method Underscore.js _.defer() Method Underscore.js _.throttle() Method Underscore.js _.debounce() Method Underscore.js _.once() Method Underscore.js _.after() Method Underscore.js _.before() Method Underscore.js _.wrap() Method Underscore.js _.negate() Method Underscore.js _.compose() Method Underscore.js _.restArguments() Method Underscore.js Functions Complete Reference 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 _.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 Objects Complete Reference Underscore.js Utility Methods Underscore.js _.noConflict() Method Underscore.js _.identity() Method Underscore.js _.constant() Method Underscore.js _.noop() Method Underscore.js _.times() Method Underscore.js _.random() Method Underscore.js _.mixin() Method Underscore.js _.iteratee() Method Underscore.js _.uniqueId() Method Underscore.js _.escape() Method Underscore.js _.unescape() Method Underscore.js _.result() Method Underscore.js _.now() Method Underscore.js _.template() Method Underscore.js Utility Complete Reference Create Quiz Comment H hardiksm73 Follow 1 Improve H hardiksm73 Follow 1 Improve Article Tags : JavaScript Web Technologies JavaScript - Underscore.js Explore JavaScript BasicsIntroduction to JavaScript4 min readVariables and Datatypes in JavaScript6 min readJavaScript Operators5 min readControl Statements in JavaScript4 min readArray & StringJavaScript Arrays7 min readJavaScript Array Methods7 min readJavaScript Strings5 min readJavaScript String Methods9 min readFunction & ObjectFunctions in JavaScript5 min readJavaScript Function Expression3 min readFunction Overloading in JavaScript4 min readObjects in JavaScript4 min readJavaScript Object Constructors4 min readOOPObject Oriented Programming in JavaScript3 min readClasses and Objects in JavaScript4 min readWhat Are Access Modifiers In JavaScript ?5 min readJavaScript Constructor Method7 min readAsynchronous JavaScriptAsynchronous JavaScript2 min readJavaScript Callbacks4 min readJavaScript Promise4 min readEvent Loop in JavaScript4 min readAsync and Await in JavaScript2 min readException HandlingJavascript Error and Exceptional Handling6 min readJavaScript Errors Throw and Try to Catch2 min readHow to create custom errors in JavaScript ?2 min readJavaScript TypeError - Invalid Array.prototype.sort argument1 min readDOMHTML DOM (Document Object Model)8 min readHow to select DOM Elements in JavaScript ?3 min readJavaScript Custom Events4 min readJavaScript addEventListener() with Examples9 min readAdvanced TopicsClosure in JavaScript4 min readJavaScript Hoisting6 min readScope of Variables in JavaScript3 min readJavaScript Higher Order Functions7 min readDebugging in JavaScript4 min read Like