UNPKG

@modern-kit/utils

Version:
14 lines (11 loc) 299 B
import { swap } from '../swap/index.mjs'; function shuffle(arr) { const result = arr.slice(); for (let i = result.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); swap(result, i, j); } return result; } export { shuffle }; //# sourceMappingURL=index.mjs.map