foxts
Version:
Opinionated collection of common TypeScript utils by @SukkaW
1 lines • 179 B
JavaScript
function t(e,r={}){let n;const{copy:l=!1,random:o=Math.random}=r,f=l?e.slice():e;let a=0,c=f.length;for(;c;)a=o()*c--|0,n=f[c],f[c]=f[a],f[a]=n;return f}export{t as shuffleArray};