Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Latest commit

 

History

History
History
51 lines (29 loc) · 1.07 KB

File metadata and controls

51 lines (29 loc) · 1.07 KB
Copy raw file
Download raw file
Edit and raw actions

Lodash documentation

_.chunk

Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements.

<CodeSandbox language="js" dependencies={["lodash"]} sandboxOptions={{expanddevtools:1,hidedevtools:0}}>

import _ from "lodash"

const chunk = _.chunk(['a', 'b', 'c', 'd'], 2);
console.log(chunk)

_.compact

Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are falsey.

<CodeSandbox language="js" dependencies={["lodash"]} sandboxOptions={{expanddevtools:1,hidedevtools:0}}>

import _ from "lodash"

const compact = _.compact([0, 1, false, 2, '', 3]);
console.log(compact)

_.concat

Creates a new array concatenating array with any additional arrays and/or values.

<CodeSandbox language="js" dependencies={["lodash"]} sandboxOptions={{expanddevtools:1,hidedevtools:0}}>

import _ from "lodash"

var array = [1];
var other = _.concat(array, 2, [3], [[4]]);

console.log(other)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.