https://github.com/xotic750/shuffle-x
Creates an array of shuffled values.
https://github.com/xotic750/shuffle-x
array browser fisher-yates-shuffle javascript nodejs shuffle
Last synced: 7 months ago
JSON representation
Creates an array of shuffled values.
- Host: GitHub
- URL: https://github.com/xotic750/shuffle-x
- Owner: Xotic750
- License: mit
- Created: 2017-08-08T00:54:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T22:55:47.000Z (almost 3 years ago)
- Last Synced: 2025-02-19T22:37:43.348Z (8 months ago)
- Topics: array, browser, fisher-yates-shuffle, javascript, nodejs, shuffle
- Language: JavaScript
- Size: 3.08 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 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](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle)
| Param | Type | Description |
| ----- | ----------------------------------------- | --------------------- |
| array |Array
\|Object
| The array to shuffle. |**Example**
```js
import shuffle from 'shuffle-x';console.log(shuffle([1, 2, 3, 4])); // e.g. [4, 1, 3, 2]
```