How it works?
This function is made to create a 2d array from a 1d array. Basically, this function is made to do something like:
[0, 1, 2, 3, 4, 5]
// | Break into parts of 2
// V
[[0, 1], [2, 3], [4, 5]]
How to use it?
This function requires 2 arguments, which are:
array
, the 1d arrayparts
, in parts of what the array will break intoExample
Let's do what I showed you before:
JS:
$.reshape($.range(5), 2) // [[0, 1], [2, 3], [4, 5]]
⚠️ Questions?
Don't hesitate to ask your questions ⁉️ in the issue part 😁