Skip to content

mesqueeb/array-shuffle

 
 

Repository files navigation

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.

About

Randomize the order of items in an array

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 78.7%
  • TypeScript 21.3%