$$partition
Partition an array to multiple constant size arrays
Usage​
{
"$$partition": [ /* values */ ],
"size": 100
}
"$$partition([size]):{input}"
Returns​
array
(of arrays of same items type as input)
Arguments​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
Primary | array | Yes | Array of elements | |
size | number | A positive integer | 100 | The size of each partition |
Examples​
Input
Definition
Output
[
"a",
"b",
"c",
"d",
"e",
"f"
]
{
"$$partition": "$",
"size": 3
}
[
[
"a",
"b",
"c"
],
[
"d",
"e",
"f"
]
]
[
"a",
"b",
"c",
"d",
"e",
"f"
]
"$$partition(3):$"
[
[
"a",
"b",
"c"
],
[
"d",
"e",
"f"
]
]