qsu
Version:
qsu is a utility library that contains useful and frequently used functions. Start with your preferred language and the modern development environment.
1 lines • 172 B
JavaScript
export function arrShuffle(t){if(1===t.length)return t[0];const r=t;for(let n=t.length-1;n>0;n-=1){const o=Math.floor(Math.random()*(n+1));[r[n],r[o]]=[t[o],t[n]]}return r}