ethers.js/packages/providers/lib/shuffle.js
2022-04-11 17:14:19 -04:00

9 lines
263 B
JavaScript

export function shuffle(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
const tmp = array[i];
array[i] = array[j];
array[j] = tmp;
}
}
//# sourceMappingURL=shuffle.js.map