Skip to content
A modern JavaScript utility library delivering modularity, performance, & extras.
JavaScript
Branch: master
Clone or download

Files

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 Ensure `orderBy` will accept iteratee path arrays #4438 (#4513) Oct 17, 2019
test Handle leading zeros in quote html entity (#4623) Feb 5, 2020
.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 Align indentations Aug 20, 2019
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
SECURITY.md Cleanup security.md document. Jul 23, 2019
add.js Remove semicolons. Feb 6, 2017
after.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
at.js Flatten at paths parameter (#4431) Aug 22, 2019
attempt.js Added arrow function in below files (#4061) Nov 18, 2018
before.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
camelCase.js Fix string methods to handle empty values (#4442) Aug 26, 2019
capitalize.js Fix string methods to handle empty values (#4442) Aug 26, 2019
castArray.js Remove semicolons. Feb 6, 2017
ceil.js add round up description on ceil documentation (#4027) Oct 28, 2018
chunk.js Coerce to integer and set default value for chunk size parameter (#4413) Aug 17, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
cloneWith.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
compact.js Use more for-of Apr 5, 2017
cond.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
conforms.js Remove semicolons. Feb 6, 2017
conformsTo.js Remove semicolons. Feb 6, 2017
countBy.js Do not use property shorthand in countBy documentation (#4405) Aug 15, 2019
create.js Remove `baseCreate`. Feb 6, 2017
debounce.js lint files (#4416) Aug 17, 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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
delay.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 Coerce drop and dropRight n param using toInteger (#4412) Aug 16, 2019
dropRight.js Coerce drop and dropRight n param using toInteger (#4412) Aug 16, 2019
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 Fix string methods to handle empty values (#4442) Aug 26, 2019
escapeRegExp.js Ensure escapeRegExp returns an empty string when passing falsy values ( Aug 22, 2019
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 lint files (#4416) Aug 17, 2019
findLastIndex.js Coerce findLastIndex and lastIndexOf fromIndex parameter to integer (#… Aug 24, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
floor.js Remove semicolons. Feb 6, 2017
flow.js Remove extraneous conditional (#4531) Nov 12, 2019
flowRight.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
get.js Remove semicolons. Feb 6, 2017
groupBy.js Missing iteratee call in `groupBy` and `keyBy`. Feb 21, 2017
gt.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
gte.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 Coerce indexOf fromIndex parameter to integer (#4410) Aug 16, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
invert.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
invertBy.js Fixin loop args order regression from 3c2795b in `invertBy`. Jul 14, 2017
invoke.js Remove `apply`. Feb 25, 2017
invokeMap.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
isArrayLikeObject.js Remove semicolons. Feb 6, 2017
isBoolean.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isBuffer.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
isDate.js Replace getTag implementation by the one from baseGetTag (remove work… Dec 11, 2018
isElement.js Remove semicolons. Feb 6, 2017
isEmpty.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
isEqualWith.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
isError.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
isFunction.js Updated the check of isFunction method (#4555) Nov 19, 2019
isLength.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
isNative.js Remove `toSource`. Apr 9, 2017
isNil.js Remove semicolons. Feb 6, 2017
isNull.js Remove semicolons. Feb 6, 2017
isNumber.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
isObject.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
isObjectLike.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
isSymbol.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 Fix string methods to handle empty values (#4442) Aug 26, 2019
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 Coerce findLastIndex and lastIndexOf fromIndex parameter to integer (#… Aug 24, 2019
lowerCase.js Fix string methods to handle empty values (#4442) Aug 26, 2019
lowerFirst.js Remove semicolons. Feb 6, 2017
lt.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
lte.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 Align indentations Aug 20, 2019
mean.js Consistent use (always) of parentheses in arrow functions. Mar 7, 2017
meanBy.js Remove semicolons. Feb 6, 2017
memoize.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 Align indentations Aug 20, 2019
multiply.js Remove semicolons. Feb 6, 2017
negate.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 Fix vulnerabilities in npm packages (#4490) Oct 3, 2019
package.json Fix vulnerabilities in npm packages (#4490) Oct 3, 2019
pad.js Fix string methods to handle empty values (#4442) Aug 26, 2019
padEnd.js Fix string methods to handle empty values (#4442) Aug 26, 2019
padStart.js Fix string methods to handle empty values (#4442) Aug 26, 2019
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 Fix parentheses placement broken in 16413cc Nov 6, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 Fix string methods to handle empty values (#4442) Aug 26, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 lint files (#4416) Aug 17, 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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
transform.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
trim.js Fix string methods to handle empty values (#4442) Aug 26, 2019
trimEnd.js Fix string methods to handle empty values (#4442) Aug 26, 2019
trimStart.js Fix string methods to handle empty values (#4442) Aug 26, 2019
truncate.js Fix string methods to handle empty values (#4442) Aug 26, 2019
unescape.js Handle leading zeros in quote html entity (#4623) Feb 5, 2020
union.js Update _.union documentation (#3758) Apr 17, 2018
unionBy.js Remove semicolons. Feb 6, 2017
unionWith.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
uniqueId.js Fix uniqueId prefix coercion (#4619) Jan 22, 2020
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
upperCase.js Fix string methods to handle empty values (#4442) Aug 26, 2019
upperFirst.js Remove semicolons. Feb 6, 2017
values.js Remove semicolons. Feb 6, 2017
without.js Remove semicolons. Feb 6, 2017
words.js Prevent ReDos in words (#4450) Aug 28, 2019
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 perfomance fixes, eslint fixes (#4482) Sep 26, 2019
zip.js Remove semicolons. Feb 6, 2017
zipObject.js Remove semicolons. Feb 6, 2017
zipObjectDeep.js Remove semicolons. Feb 6, 2017
zipWith.js perfomance fixes, eslint fixes (#4482) Sep 26, 2019

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.