@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-shuffle
Usage
import arrShuffle from '@bemoje/arr-shuffle'
arrShuffle([1, 2, 3])
//=> [2, 1, 3] - or some other random order
Tests
Uses Jest to test module functionality. Run tests to get coverage details.
npm run test
API
arrShuffle
Shuffle items in an array in-place. Runtime: O(n)
Parameters
-
arr
Array The array to shuffle.
Returns
Array The shuffled array