The Wayback Machine - https://web.archive.org/web/20190723083336/https://github.com/lodash/lodash
Skip to content
A modern JavaScript utility library delivering modularity, performance, & extras.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add .github/.lock.yml config for lock bot. Dec 27, 2018
.internal Add support for globalThis when detecting global object (#4347) Jul 2, 2019
test Fix typo in merge test (#4334) Jun 24, 2019
.editorconfig Define trim_trailing_whitespace rule for all files. Jan 27, 2016
.eslintrc.js Enable no-unexpected-multiline (#3103) Apr 12, 2017
.gitattributes Simplify .gitattributes. [ci skip] May 19, 2014
.gitignore Ignore log files that end with random numbers (#3445) Oct 23, 2017
CHANGELOG Simplify changelog reference. [ci skip] Sep 15, 2016
LICENSE Update license file with MIT title (#3498) Nov 18, 2017
README.md Remove --save option as it isn't required anymore (#4199) Feb 20, 2019
add.js Remove semicolons. Feb 6, 2017
after.js Verbiage change (#3408) Oct 3, 2017
at.js Added arrow function in below files (#4061) Nov 18, 2018
attempt.js Added arrow function in below files (#4061) Nov 18, 2018
before.js Remove coercion method use. Mar 14, 2017
camelCase.js Call upperFirst directly, instead of capitalize, in camelCase (#4075) ( Nov 25, 2018
capitalize.js converted to fat arrow function (#4059) Nov 13, 2018
castArray.js Remove semicolons. Feb 6, 2017
ceil.js add round up description on ceil documentation (#4027) Oct 28, 2018
chunk.js Remove `baseSlice`. Apr 18, 2017
clamp.js Remove coercion method use. Mar 14, 2017
clone.js tweak _.clone/_.cloneDeep docs (#4239) Mar 18, 2019
cloneDeep.js tweak _.clone/_.cloneDeep docs (#4239) Mar 18, 2019
cloneDeepWith.js Add the accepted customizer arguments to cloneDeepWith docs. Jan 14, 2018
cloneWith.js Update argument count for `cloneWith` customizer. [closes #3582] Jan 9, 2018
compact.js Use more for-of Apr 5, 2017
cond.js Fixin new `map` imports. Apr 18, 2017
conforms.js Remove semicolons. Feb 6, 2017
conformsTo.js Remove semicolons. Feb 6, 2017
countBy.js Update countBy doc example to be more at a glance friendly. [closes #… May 1, 2018
create.js Remove `baseCreate`. Feb 6, 2017
debounce.js Cancel old timer, editing pr #4139 (#4187) Feb 12, 2019
deburr.js Add extended and supplement combining marks ranges (#3932) Sep 2, 2018
defaultTo.js Remove semicolons. Feb 6, 2017
defaultToAny.js use extension resolution (#4163) Jan 20, 2019
defaults.js Remove `baseKeys` and `baseKeysIn`. Apr 16, 2017
defaultsDeep.js Remove `apply`. Feb 25, 2017
defer.js Remove semicolons. Feb 6, 2017
delay.js Remove coercion method use. Mar 14, 2017
difference.js Remove semicolons. Feb 6, 2017
differenceBy.js Remove semicolons. Feb 6, 2017
differenceWith.js Remove semicolons. Feb 6, 2017
divide.js Remove semicolons. Feb 6, 2017
drop.js Remove `baseSlice`. Apr 18, 2017
dropRight.js Remove semicolons from `dropRight`. Oct 16, 2017
dropRightWhile.js Use consistent nullish check for `array`. Mar 1, 2017
dropWhile.js Use consistent nullish check for `array`. Mar 1, 2017
each.js Remove semicolons. Feb 6, 2017
eachRight.js Remove semicolons. Feb 6, 2017
endsWith.js Fixin some leftovers bb7c959. Mar 15, 2017
eq.js Remove semicolons. Feb 6, 2017
eqDeep.js Remove semicolons. Feb 6, 2017
escape.js Add back accidentally removed semicolons to escape.js. Jul 2, 2019
escapeRegExp.js Revert "Fix typo in `escapeRegExp` (#3448)" Nov 8, 2017
every.js Fix jsdoc for `every` and `some`. Apr 16, 2017
everyValue.js Fix object coercion. Apr 16, 2017
filter.js Split `filter` out. Apr 16, 2017
filterObject.js Update `filterObject` docs to reference `pickBy` (#3861) Jul 10, 2018
findKey.js Fix typo in findKey. Aug 7, 2017
findLast.js Fix findLast missing dependency (#4259) Apr 14, 2019
findLastIndex.js Remove coercion method use. Mar 14, 2017
findLastKey.js Remove semicolons. Feb 6, 2017
first.js Remove semicolons. Feb 6, 2017
flatMap.js Remove semicolons. Feb 6, 2017
flatMapDeep.js Remove semicolons. Feb 6, 2017
flatMapDepth.js Remove coercion method use. Mar 14, 2017
flatten.js Remove semicolons. Feb 6, 2017
flattenDeep.js Remove semicolons. Feb 6, 2017
flattenDepth.js Remove coercion method use. Mar 14, 2017
flip.js Simplify `flip`. Mar 24, 2017
floor.js Remove semicolons. Feb 6, 2017
flow.js Use “composes” to describe flow/flowRight. [closes #2979] Feb 7, 2017
flowRight.js Use “composes” to describe flow/flowRight. [closes #2979] Feb 7, 2017
forEach.js Remove semicolons. Feb 6, 2017
forEachRight.js Remove semicolons. Feb 6, 2017
forOwn.js Fix object coercion. Apr 16, 2017
forOwnRight.js Fixin assignment to constant. Mar 6, 2017
fromEntries.js Create fromEntries.js (#3809) Jun 1, 2018
functions.js Remove constant function from examples (#3086) Mar 30, 2017
get.js Remove semicolons. Feb 6, 2017
groupBy.js Missing iteratee call in `groupBy` and `keyBy`. Feb 21, 2017
gt.js Remove coercion method use. Mar 14, 2017
gte.js Remove coercion method use. Mar 14, 2017
has.js Simplify `has` and `hasIn`. Feb 27, 2017
hasIn.js Simplify `has` and `hasIn`. Feb 27, 2017
hasPath.js Fixin scope range for var declarations in `hasPath` and `hasPathIn`. Apr 4, 2017
hasPathIn.js Fixin scope range for var declarations in `hasPath` and `hasPathIn`. Apr 4, 2017
head.js Adjust styling of array checks in `head`, `uniq`, `uniqBy` and `uniqW… Mar 16, 2017
inRange.js Fix typo in `inRange` (#3478) Nov 6, 2017
indexOf.js Remove coercion method use. Mar 14, 2017
initial.js Remove `baseSlice`. Apr 18, 2017
intersection.js Fixin new `map` imports. Apr 18, 2017
intersectionBy.js Fixin new `map` imports. Apr 18, 2017
intersectionWith.js Fixin new `map` imports. Apr 18, 2017
invert.js Fixin loop args order regression from 3c2795b in `invert`. Jul 14, 2017
invertBy.js Fixin loop args order regression from 3c2795b in `invertBy`. Jul 14, 2017
invoke.js Remove `apply`. Feb 25, 2017
invokeMap.js Use the `new` operator with the `Array` constructor. Mar 8, 2017
isArguments.js use extension resolution (#4163) Jan 20, 2019
isArrayBuffer.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isArrayLike.js Remove `isFunction` use. Feb 25, 2017
isArrayLikeObject.js Remove semicolons. Feb 6, 2017
isBoolean.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isBuffer.js Update object checks. Apr 24, 2017
isDate.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isElement.js Remove semicolons. Feb 6, 2017
isEmpty.js Add string example to isEmpty docs (#3647) Feb 17, 2018
isEqualWith.js Remove semicolons. Feb 6, 2017
isError.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isFunction.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isLength.js Remove semicolons. Feb 6, 2017
isMap.js internal: use util.types to migrate DEP0103 in Node.js (#3704) Mar 23, 2018
isMatch.js Remove semicolons. Feb 6, 2017
isMatchWith.js Remove semicolons. Feb 6, 2017
isNative.js Remove `toSource`. Apr 9, 2017
isNil.js Remove semicolons. Feb 6, 2017
isNull.js Remove semicolons. Feb 6, 2017
isNumber.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isObject.js Remove semicolons. Feb 6, 2017
isObjectLike.js Update object checks. Apr 24, 2017
isPlainObject.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isRegExp.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isSet.js use extension resolution (#4163) Jan 20, 2019
isString.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isSymbol.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isTypedArray.js fix reTypedTag error (#4342) Jun 26, 2019
isUndefined.js Remove semicolons. Feb 6, 2017
isWeakMap.js use extension resolution (#4163) Jan 20, 2019
isWeakSet.js use extension resolution (#4163) Jan 20, 2019
kebabCase.js Adjust spacing in template string expressions. Apr 9, 2017
keyBy.js Missing iteratee call in `groupBy` and `keyBy`. Feb 21, 2017
keys.js Remove `baseKeys` and `baseKeysIn`. Apr 16, 2017
keysIn.js Locally scope key in keysIn (#4173) Jan 27, 2019
last.js Remove semicolons. Feb 6, 2017
lastIndexOf.js Remove coercion method use. Mar 14, 2017
lowerCase.js Tiny performance improvement by not compiling regular expression each… Nov 7, 2017
lowerFirst.js Remove semicolons. Feb 6, 2017
lt.js Remove coercion method use. Mar 14, 2017
lte.js Remove coercion method use. Mar 14, 2017
map.js Split `map` out. Apr 16, 2017
mapKey.js Fix object coercion. Apr 16, 2017
mapObject.js Fix typos. Apr 16, 2017
mapValue.js Fix object coercion. Apr 16, 2017
matches.js Remove semicolons. Feb 6, 2017
matchesProperty.js Remove semicolons. Feb 6, 2017
maxBy.js Fix _.maxBy and _.minBy (#4233) Mar 12, 2019
mean.js Consistent use (always) of parentheses in arrow functions. Mar 7, 2017
meanBy.js Remove semicolons. Feb 6, 2017
memoize.js Replace MapCache by Map in memoize (#4094) (#4095) Dec 1, 2018
merge.js Remove semicolons. Feb 6, 2017
mergeWith.js Remove semicolons. Feb 6, 2017
method.js Remove constant function from examples (#3086) Mar 30, 2017
methodOf.js Remove constant function from examples (#3086) Mar 30, 2017
minBy.js Fix _.maxBy and _.minBy (#4233) Mar 12, 2019
multiply.js Remove semicolons. Feb 6, 2017
negate.js Remove semicolons. Feb 6, 2017
nth.js Remove coercion method use. Mar 14, 2017
nthArg.js Remove `baseNth`. Mar 13, 2017
once.js Remove semicolons. Feb 6, 2017
orderBy.js Allow compareMultiple to accept compare functions in addition to orde… May 1, 2018
over.js Fixin new `map` imports. Apr 18, 2017
overArgs.js Remove `apply`. Feb 25, 2017
overEvery.js Fixin `some` and `every` imports. Apr 18, 2017
overSome.js Fixin `some` and `every` imports. Apr 18, 2017
package-lock.json Add initial test files from lodash v4. (#4172) Feb 12, 2019
package.json Add initial test files from lodash v4. (#4172) Feb 12, 2019
pad.js Update _.pad* examples to show pad length < string. (#3088) Mar 30, 2017
padEnd.js Update _.pad* examples to show pad length < string. (#3088) Mar 30, 2017
padStart.js Update _.pad* examples to show pad length < string. (#3088) Mar 30, 2017
parseInt.js Remove `map` examples from `parseInt` and `trim` (#3487) Nov 10, 2017
partition.js Fixin missing accumulator return in reduce and predicate call in `par… Feb 18, 2017
pick.js Remove semicolons. Feb 6, 2017
pickBy.js Fixin new `map` imports. Apr 18, 2017
property.js Remove semicolons. Feb 6, 2017
propertyOf.js Consistent use (always) of parentheses in arrow functions. Mar 7, 2017
pull.js Remove semicolons. Feb 6, 2017
pullAll.js Use consistent nullish check for `array`. Mar 1, 2017
pullAllBy.js Use consistent nullish check for `array`. Mar 1, 2017
pullAllWith.js Use consistent nullish check for `array`. Mar 1, 2017
pullAt.js Fixin new `map` imports. Apr 18, 2017
random.js Adjust spacing in template string expressions. Apr 9, 2017
range.js Clarify doc for `range` usage with single arg (#3854) Jun 28, 2018
rangeRight.js Remove semicolons. Feb 6, 2017
reduce.js Remove semicolons. Feb 6, 2017
reduceRight.js Remove semicolons. Feb 6, 2017
reject.js Fixin `filter` imports. Apr 20, 2017
remove.js Use more destructuring. Mar 13, 2017
repeat.js Math them all. Apr 4, 2017
replace.js Adjust spacing in template string expressions. Apr 9, 2017
result.js Remove constant function from examples (#3086) Mar 30, 2017
round.js Remove semicolons. Feb 6, 2017
sample.js Simplify `shuffle` and `sample`. Feb 7, 2017
sampleSize.js Remove semicolons from `sampleSize` and `baseClone` May 15, 2018
set.js Remove semicolons. Feb 6, 2017
setWith.js Remove semicolons. Feb 6, 2017
shuffle.js Fixin import path to copyArray. (#3000) Feb 13, 2017
size.js Remove `baseKeys` and `baseKeysIn`. Apr 16, 2017
slice.js Add example of Array slice (#3823) Jun 12, 2018
snakeCase.js add snakeCase example with digit (#3993) Oct 8, 2018
some.js Fix jsdoc for `every` and `some`. Apr 16, 2017
someValue.js Fix object coercion. Apr 16, 2017
sortedIndex.js Remove semicolons. Feb 6, 2017
sortedIndexBy.js Remove semicolons. Feb 6, 2017
sortedIndexOf.js Remove semicolons. Feb 6, 2017
sortedLastIndex.js Remove semicolons. Feb 6, 2017
sortedLastIndexBy.js Remove semicolons. Feb 6, 2017
sortedLastIndexOf.js Remove semicolons. Feb 6, 2017
sortedUniq.js Remove trailing space in `sortedUniq`. Oct 16, 2017
sortedUniqBy.js Use consistent nullish check for `array`. Mar 1, 2017
split.js Remove `toString` coercion method use. Mar 15, 2017
startCase.js Adjust spacing in template string expressions. Apr 9, 2017
startsWith.js Adjust spacing in template string expressions. Apr 9, 2017
subtract.js Remove semicolons. Feb 6, 2017
sum.js Consistent use (always) of parentheses in arrow functions. Mar 7, 2017
sumBy.js Use consistent nullish check for `array`. Mar 1, 2017
tail.js Remove unused var from tail(). Jun 15, 2018
take.js Remove `baseSlice`. Apr 18, 2017
takeRight.js Remove `baseSlice`. Apr 18, 2017
takeRightWhile.js Use consistent nullish check for `array`. Mar 1, 2017
takeWhile.js Use consistent nullish check for `array`. Mar 1, 2017
throttle.js Change type check and the way of sending params. (#4145) Jan 11, 2019
times.js Minor doc format (#4285) Apr 28, 2019
toArray.js Assume Symbol is always defined (#4111) Dec 11, 2018
toFinite.js Remove semicolons. Feb 6, 2017
toInteger.js Fix #3466 (#3467) Nov 2, 2017
toLength.js Remove `baseClamp`. Mar 12, 2017
toNumber.js Adjust spacing in template string expressions. Apr 9, 2017
toPath.js Fixin new `map` imports. Apr 18, 2017
toPlainObject.js Fix typo in toPlainObject(). Apr 15, 2019
toSafeInteger.js Remove `baseClamp`. Mar 12, 2017
toString.js Assume Symbol is always defined (#4111) Dec 11, 2018
transform.js Remove `isFunction` use. Feb 25, 2017
trim.js Remove `map` examples from `parseInt` and `trim` (#3487) Nov 10, 2017
trimEnd.js Remove `toString` coercion method use. Mar 15, 2017
trimStart.js Remove `toString` coercion method use. Mar 15, 2017
truncate.js Adjust spacing in template string expressions. Apr 9, 2017
unescape.js Remove `toString` coercion method use. Mar 15, 2017
union.js Update _.union documentation (#3758) Apr 17, 2018
unionBy.js Remove semicolons. Feb 6, 2017
unionWith.js Remove semicolons. Feb 6, 2017
uniq.js Adjust styling of array checks in `head`, `uniq`, `uniqBy` and `uniqW… Mar 16, 2017
uniqBy.js Adjust styling of array checks in `head`, `uniq`, `uniqBy` and `uniqW… Mar 16, 2017
uniqWith.js Add missing space in uniqWith docblock (#3995) Oct 9, 2018
uniqueId.js Tiny style correction in `uniqueId` and `compareMultiple` May 15, 2018
unset.js Remove semicolons. Feb 6, 2017
unzip.js Fixin `filter` imports. Apr 20, 2017
unzipWith.js Fixin new `map` imports. Apr 18, 2017
update.js _.update() docs grammar fix (#3264) Jul 17, 2017
updateWith.js Remove constant function from examples (#3086) Mar 30, 2017
upperCase.js Adjust spacing in template string expressions. Apr 9, 2017
upperFirst.js Remove semicolons. Feb 6, 2017
values.js Remove semicolons. Feb 6, 2017
without.js Remove semicolons. Feb 6, 2017
words.js Simplify `words`. Mar 27, 2017
xor.js Use native filter instead of custom one where possible (#4116) Dec 11, 2018
xorBy.js Use native filter instead of custom one where possible (#4116) Dec 11, 2018
xorWith.js Use native filter instead of custom one where possible (#4116) Dec 11, 2018
zip.js Remove semicolons. Feb 6, 2017
zipObject.js Remove semicolons. Feb 6, 2017
zipObjectDeep.js Remove semicolons. Feb 6, 2017
zipWith.js Remove semicolons. Feb 6, 2017

README.md

lodash

Site | Docs | FP Guide | Contributing | Wiki | Code of Conduct | Twitter | Chat

The Lodash library exported as a UMD module.

Generated using lodash-cli:

$ npm run build
$ lodash -o ./dist/lodash.js
$ lodash core -o ./dist/lodash.core.js

Download

Lodash is released under the MIT license & supports modern environments.
Review the build differences & pick one that’s right for you.

Installation

In a browser:

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

Using npm:

$ npm i -g npm
$ npm i lodash

Note: add --save if you are using npm < 5.0.0

In Node.js:

// Load the full build.
var _ = require('lodash');
// Load the core build.
var _ = require('lodash/core');
// Load the FP build for immutable auto-curried iteratee-first data-last methods.
var fp = require('lodash/fp');

// Load method categories.
var array = require('lodash/array');
var object = require('lodash/fp/object');

// Cherry-pick methods for smaller browserify/rollup/webpack bundles.
var at = require('lodash/at');
var curryN = require('lodash/fp/curryN');

Looking for Lodash modules written in ES6 or smaller bundle sizes? Check out lodash-es.

Why Lodash?

Lodash makes JavaScript easier by taking the hassle out of working with arrays,
numbers, objects, strings, etc. Lodash’s modular methods are great for:

  • Iterating arrays, objects, & strings
  • Manipulating & testing values
  • Creating composite functions

Module Formats

Lodash is available in a variety of builds & module formats.

You can’t perform that action at this time.