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