Skip to content

Instantly share code, notes, and snippets.

View mrleblanc101's full-sized avatar

Sébastien LeBlanc mrleblanc101

View GitHub Profile

Columnize

Split an array into equal with objects

const columnize = (array, column, columns) => {
    const total = array.length;
    const perCol = Math.ceil(total / columns);
    let start = perCol * (column - 1);
 const end = perCol * column;