Creates an array of elements split into groups the length of size. If the array cannot be split evenly, the final chunk holds the remaining elements. Part of Lodash 4.x Array.
Pass the required arguments shown below. Lodash Array helpers usually return a new value — check whether the source array is mutated.
Syntax
Call _.chunk on an array. Start with this line.
Lodash
_.chunk(array, [size=1])
Call
What it does
_.chunk(array, [size=1])
Primary signature.
_.chunk(array)
Call with an array argument.
Prefer import chunk from "lodash/chunk" when you want a smaller bundle.
Library declarations
Lodash
_.chunk(array, [size=1])
Parameters
Parameter
Description
array
Required. Source to split
size
Optional. Chunk length; default 1
Return Value
Return Value
Description
*
New array of chunk arrays
Lodash Examples
Example 1 — Official: Even Split
When length is a multiple of size, every chunk has the same length.
One pass. All items fit in the first (and only) chunk.
Outer length.ceil(3 / 10) = 1.
Tip. Oversized size is fine — you still get a nested array.
Compatibility
Browser & Runtime Support
_.chunk is a Lodash 4.x Array helper. It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 4.x
_.chunk()
Available in [email protected] full builds and the lodash/chunk modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.x
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.chunkLodash 4.x+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import chunk from "lodash/chunk" for smaller builds. Not a native browser API — load Lodash first.
Frequently Asked Questions
_.chunk(array, size) splits an array into groups of length size. It returns a new array of those groups. If the length is not divisible by size, the last group holds the remaining elements.
No. It returns a new outer array of chunk arrays. The source array is left unchanged. Object elements inside are still shared by reference — chunking does not deep-clone.
When size is omitted, Lodash defaults to 1 — each element becomes its own one-item chunk.
_.chunk([], size) returns []. There are no inner arrays.
Use import chunk from "lodash/chunk" or require("lodash/chunk") so bundlers can tree-shake unused Lodash code. Full build: import _ from "lodash" then _.chunk.
Yes for in-memory batches (UI pages, API workers). For database pagination you still need LIMIT/OFFSET or cursors at the query layer — chunk only reshapes arrays you already hold.