am wonder how to do this one, can you help me to learn how to think and solve this kind of problem, please?
in this example i will use 8 like N
let original = [1,2,3,4,5,6,7,8,9,10];
//to
let modified = [[1,2,3,4,5,6,7,8],[9,10]]
for example if i use a Array.slice
and i have more than the example number like 19 elements inside original
i need to create a new array inside to modified
and should be look like this :
[[1,2,3,4,5,6,7,8],[9,10,11,12,13,14,15,16],[17,18,19]]
is dynamic