1.0.0 • Published 8 years ago

sort-into-columns v1.0.0

Weekly downloads
76
License
-
Repository
-
Last release
8 years ago

Sort an array so that it'll display in columns when output inline.

var originalOrder = [0, 1, 2, 3, 4, 5, 6, 7];

sortIntoColumns(originalOrder, 3);
// [
//   0, 3, 6,
//   1, 4, 7,
//   2, 5
// ]

sortIntoColumns(originalOrder, 2);
// [
//   0, 4,
//   1, 5,
//   2, 6,
//   3, 7
// ]
1.0.0

8 years ago