i have a data structure of a flat array of numbers
[145, 46, 200, 3, 178, 206, 73, 228, 165, 65, 6, 141, 73, 90, 181, 100]
i need to make an array of arrays with a max of 3 items per sub array. So i look at some examples, and Enum.chunk(arr, n)
seems like a candidate
so .chuck(arr, 3) says its deprecated, use chuck_every(arr, 3) instead, so i did that and it produces a strange result vs chunk
for example: chunk returns
[[145, 46, 200], [3, 178, 206], [73, 228, 165], [65, 6, 141], [73, 90, 181]]
while chunk_every returns
[145, 46, 200],
[3, 178, 206],
[73, 228, 165],
[65, 6, 141],
[73, 90, 181],
'p']
the main difference being an extra random element which is a string???
it's almost like it converted the element that chunk cuts off and converts it to a string?
Naturally I am expecting the replacement method would have the same output given the same input. Right?