1.0.4 • Published 9 years ago

qshuffle v1.0.4

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
9 years ago

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 ]