lodash

4.18.1 · active · verified Sat Apr 18

lodash is a JavaScript utility library providing consistent, cross-environment, performance-optimized, and modular utilities for common programming tasks. It simplifies working with arrays, objects, numbers, strings, and functions, offering a wide range of helpers for iteration, manipulation, and type checking. The current stable version is 4.18.1, with frequent updates for bug fixes and security patches, typically released as minor or patch versions.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates importing the full lodash library and using the `_.filter` method to process an array of objects.

import _ from 'lodash';

const users = [
  { 'user': 'barney', 'age': 36, 'active': true },
  { 'user': 'fred',   'age': 40, 'active': false }
];

const activeUsers = _.filter(users, function(o) { return o.active; });

console.log(activeUsers);
// Expected output: [ { user: 'barney', age: 36, active: true } ]

view raw JSON →