A modern JavaScript utility library delivering modularity, performance, & extras.
JavaScript
Permalink
Failed to load latest commit information.
.github Fix CoC link in .github/CONTRIBUTING.md (#3156) May 13, 2017
.internal Fix operator in `createMathOperation`. (#3499) Nov 17, 2017
.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 Add jsDelivr hits badge (#3418) Oct 9, 2017
add.js Remove semicolons. Feb 6, 2017
after.js Verbiage change (#3408) Oct 3, 2017
ary.js Remove guard params. Mar 5, 2017
assignWith.js Remove semicolons. Feb 6, 2017
at.js Remove semicolons. Feb 6, 2017
attempt.js Remove `apply`. Feb 25, 2017
before.js Remove coercion method use. Mar 14, 2017
bindKey.js Remove semicolons. Feb 6, 2017
camelCase.js Adjust spacing in template string expressions. Apr 9, 2017
capitalize.js Remove `toString` coercion method use. Mar 15, 2017
castArray.js Remove semicolons. Feb 6, 2017
ceil.js Remove semicolons. Feb 6, 2017
chunk.js Remove `baseSlice`. Apr 18, 2017
clamp.js Remove coercion method use. Mar 14, 2017
clone.js Remove semicolons. Feb 6, 2017
cloneDeep.js Remove semicolons. Feb 6, 2017
cloneDeepWith.js Remove semicolons. Feb 6, 2017
cloneWith.js Remove semicolons. Feb 6, 2017
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 Missing iteratee call in `countBy` (missed in 5baad4d). Feb 22, 2017
create.js Remove `baseCreate`. Feb 6, 2017
curry.js Remove guard params. Mar 5, 2017
curryRight.js Remove guard params. Mar 5, 2017
debounce.js Commit and whitespace nits in debounce. Oct 2, 2017
deburr.js Adjust spacing in template string expressions. Apr 9, 2017
defaultTo.js Remove semicolons. Feb 6, 2017
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 Remove `toString` coercion method use. Mar 15, 2017
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 Fix object coercion. Apr 16, 2017
find.js Fix typo in `find`. Apr 16, 2017
findKey.js Fix typo in findKey. Aug 7, 2017
findLast.js Remove semicolons. Feb 6, 2017
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
fromPairs.js Use more for-of Apr 3, 2017
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 Update object checks. Apr 24, 2017
isArrayBuffer.js Consistent use (always) of parentheses in arrow functions. Mar 7, 2017
isArrayLike.js Remove `isFunction` use. Feb 25, 2017
isArrayLikeObject.js Remove semicolons. Feb 6, 2017
isBoolean.js Remove semicolons. Feb 6, 2017
isBuffer.js Update object checks. Apr 24, 2017
isDate.js Consistent use (always) of parentheses in arrow functions. Mar 7, 2017
isElement.js Remove semicolons. Feb 6, 2017
isEmpty.js Remove `baseKeys` and `baseKeysIn`. Apr 16, 2017
isEqualWith.js Remove semicolons. Feb 6, 2017
isError.js Remove semicolons. Feb 6, 2017
isFunction.js Remove semicolons. Feb 6, 2017
isLength.js Remove semicolons. Feb 6, 2017
isMap.js Consistent use (always) of parentheses in arrow functions. Mar 7, 2017
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 Remove semicolons. Feb 6, 2017
isObject.js Remove semicolons. Feb 6, 2017
isObjectLike.js Update object checks. Apr 24, 2017
isPlainObject.js Faster/simpler isPlainObject check (#3483) Nov 8, 2017
isRegExp.js Consistent use (always) of parentheses in arrow functions. Mar 7, 2017
isSet.js Update object checks. Apr 24, 2017
isString.js Simplify isType methods. Feb 11, 2017
isSymbol.js Simplify isType methods. Feb 11, 2017
isTypedArray.js Update object checks. Apr 24, 2017
isUndefined.js Remove semicolons. Feb 6, 2017
isWeakMap.js Update object checks. Apr 24, 2017
isWeakSet.js Update object checks. Apr 24, 2017
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
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 Use more for-of Apr 3, 2017
mean.js Consistent use (always) of parentheses in arrow functions. Mar 7, 2017
meanBy.js Remove semicolons. Feb 6, 2017
memoize.js Remove semicolons. Feb 6, 2017
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 Use more for-of Apr 3, 2017
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 Remove guard params. Mar 5, 2017
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.json Proper `style` npm script execution (#3103). Apr 14, 2017
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 Remove semicolons. Feb 6, 2017
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 coercion method use. Mar 14, 2017
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 Remove `baseSlice`. Apr 18, 2017
snakeCase.js Adjust spacing in template string expressions. Apr 9, 2017
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 Simplify `tail`. Mar 24, 2017
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
template.js Adjust spacing in template string expressions. Apr 9, 2017
templateSettings.js Remove semicolons. Feb 6, 2017
throttle.js Remove semicolons. Feb 6, 2017
times.js Remove constant function from examples (#3086) Mar 30, 2017
toArray.js Remove semicolons. Feb 6, 2017
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 Eslint cleanup (imports left), except template. Feb 17, 2017
toSafeInteger.js Remove `baseClamp`. Mar 12, 2017
toString.js Fixin new `map` imports. Apr 18, 2017
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 Remove semicolons. Feb 6, 2017
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 Adjust styling of array checks in `head`, `uniq`, `uniqBy` and `uniqW… Mar 16, 2017
uniqueId.js default prefix to empty string (#3214) Jun 20, 2017
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 Fixin `filter` imports. Apr 20, 2017
xorBy.js Fixin `filter` imports. Apr 20, 2017
xorWith.js Fixin `filter` imports. Apr 20, 2017
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 v4.17.4

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 --save lodash

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');

Note:
Install n_ for Lodash use in the Node.js < 6 REPL.

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.