Convert list to matrix
Code copied from https://stackoverflow.com/a/4492417/2075423
listToMatrix([1, 2, 3, 4, 5, 6, 7, 8, 9], 3)
// => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
Convert list to matrix
Code copied from https://stackoverflow.com/a/4492417/2075423
listToMatrix([1, 2, 3, 4, 5, 6, 7, 8, 9], 3)
// => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]