1 line of code: How to split an Array in half
const splitInHalf = arr =&gt; [arr.slice(0, Math.ceil(arr.length / 2)),...
Tags: javascript, webdev, performance, codequality