Skip to main content

$$partition

Partition an array to multiple constant size arrays

Usage​

{ 
"$$partition": /* Array of elements */,
"size": 100 /* integer */
}
"$$partition([size]):{input}"
note

Concrete values in the usage example are default values.

Returns​

array[] - of same items type as input

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryarrayYesArray of elements
sizeinteger100The size of each partition

Examples​

Input

Definition

Output

[
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
]
"$$partition(3):$"
[
[
1,
2,
3
],
[
4,
5,
6
],
[
7,
8,
9
],
[
10
]
]
[
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
]
{
"$$partition": "$",
"size": 3
}
[
[
1,
2,
3
],
[
4,
5,
6
],
[
7,
8,
9
],
[
10
]
]