UNPKG

@prelude/array

Version:

Array module.

12 lines 294 B
import swap from './swap.js'; /** In-place shuffle. */ const shuffle = (values) => { let n = values.length; while (n) { const i = Math.floor(Math.random() * n--); swap(values, n, i); } return values; }; export default shuffle; //# sourceMappingURL=shuffle.js.map