Miss any of our Open RFC calls?Watch the recordings here! »

array-shuffle

2.0.0 • Public • Published

array-shuffle

Randomize the order of items in an array

Uses the Durstenfeld algorithm based on the Fisher–Yates algorithm.

Install

$ npm install array-shuffle

Usage

const shuffled = arrayShuffle([1, 2, 3, 4, 5, 6]);
//=> [3, 5, 4, 1, 2, 6]

API

arrayShuffle(array)

array

Type: array

The array to shuffle.

Install

npm i array-shuffle

DownloadsWeekly Downloads

16,474

Version

2.0.0

License

MIT

Unpacked Size

3.02 kB

Total Files

5

Last publish

Collaborators

  • avatar