Skip to main content

Lodash

Lodash is a high-performance JavaScript utility library that internally encapsulates many functions for handling common data types such as strings, arrays, and objects, which can greatly improve the efficiency of development.

Reference Document

Lodash API

Example

// Numerical summation
const sum = _.add(1, 2); // => 3

// Array de-duplication
const uniqArr = _.uniq([1, 2, 2, 3, 3]); // => [1, 2, 3]

// Array reverse order
const reversedArr = _.reverse([3, 2, 5]); // => [5, 2, 3]