4.2.0 • Published 1 year ago

just-shuffle v4.2.0

Weekly downloads
736
License
MIT
Repository
github
Last release
1 year ago

just-shuffle

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-shuffle
yarn add just-shuffle

Return the elements of an array in random order

import shuffle from 'just-shuffle';

shuffle([1, 2, 3]); 
// array with original elements randomly sorted
shuffle([1, 2, 3], {shuffleAll: true}); 
// array with original elements randomly sorted and all in new postions
shuffle([]); // []
shuffle([1]); // [1]
shuffle(); // throws
shuffle(undefined); // throws
shuffle(null); // throws
shuffle({}); // throws
4.2.0

1 year ago

4.1.0

2 years ago

4.1.1

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.1.0

3 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.1.0

6 years ago

2.0.0

7 years ago

1.0.0

8 years ago