Question : How to split an Array in half
Answered by : graceful-grasshopper-nr6wt3dgljdo
const splitInHalf = arr => [arr.slice(0, Math.ceil(arr.length / 2)), arr.slice(Math.ceil(arr.length / 2))];
Source : https://dev.to/martinkr/1-line-of-code-how-to-split-an-array-in-half-4hkj | Last Update : Thu, 03 Feb 22