shuffle-and-split
v1.0.2
Published
Shuffles and split an array into groups.
Downloads
2
Readme
Shuffle and Split
Shuffles and split an array into groups.
var shuffleAndSplit = require('shuffle-and-split')
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
shuffleAndSplit(arr, 3)
// result
// [
// [ 8, 3, 11, 2 ],
// [ 1, 7, 6, 10 ],
// [ 9, 5, 12, 4 ]
// ]
Enjoy.