shuffle-x

2.2.2 • Public • Published

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

shuffle-x

Creates an array of shuffled values.

module.exports(array)Array

Creates an array of shuffled values.

Kind: Exported function
Returns: Array - Returns the new shuffled array.
Throws:

  • TypeError If array is null or undefined.

See: https://en.wikipedia.org/wiki/Fisher-Yates_shuffle

Param Type Description
array Array | Object The array to shuffle.

Example

import shuffle from 'shuffle-x';

console.log(shuffle([1, 2, 3, 4])); // e.g. [4, 1, 3, 2]

Package Sidebar

Install

npm i shuffle-x

Weekly Downloads

2

Version

2.2.2

License

MIT

Unpacked Size

274 kB

Total Files

11

Last publish

Collaborators

  • xotic750