qshuffle

1.0.4 • Public • Published

qshuffle

Rearrange the order of the elements in the array. Works in-place and modifies the input array, but also returns it.

So it turns out my approach is already known as the Fisher-Yates shuffle. See npm array-shuffle and shuffle-array.


Sample usage:

    var shuffle = require('qshuffle');

    var a = [1,2,3,4];
    shuffle(a);

    console.log(a);
    // outputs eg [ 4, 1, 3, 2 ]

Dependents (0)

Package Sidebar

Install

npm i qshuffle

Weekly Downloads

0

Version

1.0.4

License

Apache-2.0

Last publish

Collaborators

  • andrasq