Distributes arg among n amount of smaller iterators. Does not maintain order so if order is important, use divide instead.
arg
n
divide
distribute(range(3), 3)].map(v => toArray(v)); // [[0], [1], [2]], distribute(range(6), 2)].map(v => toArray(v)); // [[0, 2, 4], [1, 3, 5]] Copy
distribute(range(3), 3)].map(v => toArray(v)); // [[0], [1], [2]], distribute(range(6), 2)].map(v => toArray(v)); // [[0, 2, 4], [1, 3, 5]]
Distributes
arg
amongn
amount of smaller iterators. Does not maintain order so if order is important, usedivide
instead.