This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
StasisWarden-Legacy/node_modules/es-toolkit/dist/array/shuffle.mjs
T

11 lines
267 B
JavaScript

function shuffle(arr) {
const result = arr.slice();
for (let i = result.length - 1; i >= 1; i--) {
const j = Math.floor(Math.random() * (i + 1));
[result[i], result[j]] = [result[j], result[i]];
}
return result;
}
export { shuffle };