Skip to main content
Module

x/lodash_es/mod.ts>chunk

lodash for deno use
Latest
function chunk
import { chunk } from "https://deno.land/x/lodash_es@v0.0.2/mod.ts";

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.

Examples

_.chunk(['a', 'b', 'c', 'd'], 2); // => [['a', 'b'], ['c', 'd']]

_.chunk(['a', 'b', 'c', 'd'], 3); // => [['a', 'b', 'c'], ['d']]

Parameters

array

The array to process.

size
guard