Partitions a readonly array or tuple T into sub-arrays/tuples of length N. Delegates to Tuple.Partition.
T
N
Tuple.Partition
The desired size of each partition (must be a positive integer literal).
The readonly array or tuple type to partition.
A readonly array/tuple where each element is a sub-array/tuple of length N.
type P1 = List.Partition<2, [1, 2, 3, 4, 5]>; // readonly [[1, 2], [3, 4], [5]]type P2 = List.Partition<3, readonly number[]>; // readonly (readonly number[])[]type P3 = List.Partition<1, [1, 2]>; // readonly [[1], [2]] Copy
type P1 = List.Partition<2, [1, 2, 3, 4, 5]>; // readonly [[1, 2], [3, 4], [5]]type P2 = List.Partition<3, readonly number[]>; // readonly (readonly number[])[]type P3 = List.Partition<1, [1, 2]>; // readonly [[1], [2]]
Partitions a readonly array or tuple
Tinto sub-arrays/tuples of lengthN. Delegates toTuple.Partition.