You are viewing a single comment's thread. Return to all comments →
I started with the same approach, but there is a gotcha in there.
[1,2,3,4].slice(2,6) will return [3,4]. So the length of a new array is only 2. Have no idea how to fix it so I decided to use the inner cycle.