-
Notifications
You must be signed in to change notification settings - Fork 0
array.Function.chunk
soetas edited this page Nov 30, 2024
·
3 revisions
estdlib v0.1.2 / array / chunk
chunk<
T
>(array
,size
):never
[]
Creates an array of elements split into groups the length of size
• T
Type of objects the array contains
• array: T
[]
The array to process
• size: number
= 1
The length of each chunk
never
[]
- Returns the new array of chunks
0.1.2
chunk(['a', 'b', 'c', 'd'], 2)
// => [['a', 'b'], ['c', 'd']]
chunk(['a', 'b', 'c', 'd'], 3)
// => [['a', 'b', 'c'], ['d']]
Docs made with by typedoc、typedoc-plugin-markdown & typedoc-github-wiki-theme.