Lo-Dash v1.0.0-rc.3
An alternative to Underscore.js, delivering consistency, customization, performance, and extra features.
Download
Dive in
We’ve got API docs, benchmarks, and unit tests.
For a list of upcoming features, check out our roadmap.
Screencasts
For more information check out these screencasts over Lo-Dash:
Features
Support
Lo-Dash has been tested in at least Chrome 523, Firefox 117, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.16, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.
Installation and usage
In browsers:
<script src="lodash.js"></script>
Using npm
:
npm install lodash
npm install -g lodash
npm link lodash
To avoid potential issues, update npm
before installing Lo-Dash:
npm install npm -g
In Node.js and RingoJS v0.8.0+:
var _ = require('lodash');
var _ = require('lodash/lodash.underscore');
Note: If Lo-Dash is installed globally, run npm link lodash
in your project’s root directory before requiring it.
In RingoJS v0.7.0-:
var _ = require('lodash')._;
In Rhino:
load('lodash.js');
In an AMD loader like RequireJS:
require({
'paths': {
'underscore': 'path/to/lodash'
}
},
['underscore'], function(_) {
console.log(_.VERSION);
});
Resolved Underscore.js issues
- Allow iteration of objects with a
length
property [#799, test] - Fix cross-browser object iteration bugs [#60, #376, test]
- Methods should work on pages with incorrectly shimmed native methods [#7, #742, test]
_.isEmpty
should support jQuery/MooTools DOM query collections [#690, test]_.isObject
should avoid V8 bug #2291 [#605, test]_.keys
should work with arguments
objects cross-browser [#396, test]_.range
should coerce arguments to numbers [#634, #683, test]
Release Notes
v1.0.0-rc.3
Compatibility Warnings
- Made
_#join
, _#pop
, and _#shift
wrapper methods return unwrapped values - Made “Functions” methods wrapper counterparts return wrapped values
- Removed
_.chain
and _#chain
methods
Changes
- Added _.cloneDeep alias of
_.clone(…, true)
- Added
_.once
to the backbone
build method dependencies - Ensured
backbone
builds implement Underscore’s chaining behavior - Ensured the
settings=…
build option doesn’t clobber the default moduleId
- Ensured Lo-Dash’s
npm
package installation avoids erroring when no other modules have been globally installed - Made compiled templates loaded via AMD use the Lo-Dash module for their
_
references - Removed the “Collections” method
_.forEach
dependency from “Arrays” method _.intersection
- Optimized
_.isArray
and _.isFunction
fallbacks as well as
_.intersection
, _.isDate
, _.isRegExp
, _.reduce
, _.reduceRight
, _.union
, and _.uniq
v1.0.0-rc.2
- Specified more method chaining behaviors
- Updated
underscore
build compatibility to v1.4.3
v1.0.0-rc.1
Compatibility Warnings
- Made
_(…)
intuitively chain without needing to call _#chain
- Made
_.isEqual
equate arguments
objects to similar Object
objects - Made
_.clone
copy the enumerable properties of arguments
objects and objects
created by constructors other than Object
are cloned to plain Object
objects
Changes
- Ensure Lo-Dash runs in the JS engine embedded in Adobe products
- Ensured
_.reduce
and _.reduceRight
pass the correct number of callback
arguments - Ensured
_.throttle
nulls the timeoutId
- Made deep
_.clone
more closely follow the structured clone algorithm and copy array properties assigned by RegExp#exec
- Optimized compiled templates in Firefox
- Optimized
_.forEach
, _.forOwn
, _.isNumber
, and _.isString
- Simplified
iteratorTemplate
The full changelog is available here.
BestieJS
Lo-Dash is part of the BestieJS “Best in Class” module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
Author
Contributors