1.0.1 • Published 6 years ago
@bemoje/arr-shuffle v1.0.1
@bemoje/arr-shuffle
Shuffle items in an array in-place. Runtime: O(n)
Version
Travis CI
Dependencies
Stats
Donate
Installation
npm install @bemoje/arr-shuffle
npm install --save @bemoje/arr-shuffle
npm install --save-dev @bemoje/arr-shuffleUsage
import arrShuffle from '@bemoje/arr-shuffle'
arrShuffle([1, 2, 3])
//=> [2, 1, 3] - or some other random orderTests
Uses Jest to test module functionality. Run tests to get coverage details.
npm run testAPI
arrShuffle
Shuffle items in an array in-place. Runtime: O(n)
Parameters
arrArray The array to shuffle.
Returns
Array The shuffled array