shufflefy
v1.0.4
Published
To shuffle an Array.
Downloads
36
Maintainers
Readme
shufflefy
A Node.js package to shuffle an array.
Usage
Install the package using npm:
npm install shufflefy
Require the package:
const shufflefy = require('shufflefy');
Feed it with an array:
const numberArr = [1, 2, 3, 4, 5, 6, 7];
console.log(shufflefy(numberArr));
Arguments list:
shufflefy(input_arr[, iteration[, starting_seed[, randomizer]]])
input_arr - input array
iteration - number of iterations over the output array
starting_seed - same starting_seed and iteration combination would always generate the same result
randomizer - a function that takes in a seed(optional) and returns a number between 0 (inclusive) and 1 (exclusive)
Test:
npm test
Examples:
node example.js
Benchmarking:
node benchmark.js
License
MIT