← All open source projects

Lodash

lodash/lodash

Lodash is a JavaScript utility library for arrays, objects, functions, and collections.

Forks 7,171
Author lodash
Language JavaScript
License NOASSERTION
Synced 2026-06-27

What it is

Lodash is a JavaScript utility library. It provides functions for arrays, objects, strings, collections, functions, type checks, and data transformation.

It became popular when the JavaScript standard library was much smaller. Lodash solved everyday tasks: grouping data, deep cloning, throttling calls, and safely reading nested values.

How it is used

Lodash fits repeated data manipulation. Instead of writing many small helpers, teams use known primitives with stable behavior.

Some features now exist in JavaScript itself, but Lodash remains useful for compatibility, older code, and convenience.

Grouping and debouncing

This example shows two typical Lodash tasks: transform a collection and prevent a handler from running too often.

Language: JavaScript
import groupBy from 'lodash/groupBy';
import debounce from 'lodash/debounce';

const byStatus = groupBy(tasks, 'status');

const saveDraft = debounce((text) => {
  api.save({ text });
}, 400);

What is inside

The repository contains library code, modular builds, documentation, tests, and material around different module formats. Lodash can be imported as a whole or function by function.

The FP variant is also important for function composition and immutable transformations.

Practical context

For new projects, a good strategy is importing individual functions and regularly checking what modern JavaScript already covers. Lodash is best as a precise tool, not an automatic dependency.

Strengths and limits

The main strength is reliable everyday data handling. API data contains nulls, nesting, mixed collections, and unexpected types. Lodash makes many of those operations predictable.

The limit is unnecessary dependency weight. In new projects, it is worth checking modern JavaScript first and importing only what is needed.