https://tutorial.eyehunts.com/js/javascript-split-array-into-chunk-two-based-condition/
JavaScript split array | into a chunk, two based on condition