Re:
by paddw on Monday May 22, 2023 @11:14PM
(#36039357)
Cool project! Might be nice to include a random permutation method.
[ Parent
| on HN ]
const randomPermutation = arr => intSequence(0, arr.length - 1).map(i => arr[i])
console.log(randomPermutation(['a', 'b', 'c'])I believe sequence will accomplish what you're looking for here
const randomSeq = sequence([1,2,3]) // could return [3,1,2], [2,3,1], etc.