Workshop.codes
Create

Array Chunk Last updated August 29, 2025

Description

Returns a two-dimensional array produced by dividing a specified array into consecutive sub-arrays of a given size. The final chunk may be smaller than the specified size if the array length is not evenly divisible. Useful for paginating player lists, distributing players into balanced groups, or processing large arrays in batches.

Snippet

Array Chunk(All Players(All Teams), 3);

Properties

Returns: Array
Parameters: Array, Chunk Size

Array
Type: Array, Default: Empty Array
The array to divide into chunks.

Chunk Size
Type: Number, Default: 2
The maximum number of elements in each chunk. Must be at least 1.

Workshop.codes