Lo-Dash v2.4.1

A utility library delivering consistency, customization, performance, & extras.

_.assign({ 'a': 1 }, { 'b': 2 }, { 'c': 3 });
// → { 'a': 1, 'b': 2, 'c': 3 }
_.map([1, 2, 3], function(n) { return n * 3; });
// → [3, 6, 9]

Documentation

Download

Review the build differences & pick the one that’s right for you.

CDN copies are available on cdnjs & jsDelivr.
Create custom builds with only the features you need.
Love modules? We’ve got you covered with lodash-amd, lodash-node, & npm packages per method.

Dive in

Check out our unit tests, benchmarks, changelog, roadmap, as well as community created podcasts, posts, & videos.

Installation

In a browser:

<script src="lodash.js"></script>

In an AMD loader:

require(['lodash'], function(_) {/*…*/});

Using npm:

$ npm i --save lodash

$ {sudo -H} npm i -g lodash
$ npm ln lodash

In Node.js:

var _ = require('lodash');
// or as Underscore
var _ = require('lodash/dist/lodash.underscore');

Note:
Don’t assign values to the special variable_” when in the REPL

Features not in Underscore

Support

Tested in Chrome (19, 35-36), Firefox (3, 20, 30-31), IE 6-11, Opera 22-23, Safari 5-7, Node.js 0.8.26~0.10.30, PhantomJS 1.9.7, RingoJS 0.9, & Rhino 1.7RC5.

Automated browser test runs are available as well as CI runs for lodash, lodash-cli, lodash-amd, lodash-node, & grunt-lodash. Special thanks to Sauce Labs for providing automated browser testing.