npm

Need private packages and team management tools?Check out npm Orgs. »

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 ]

install

npm i qshuffle

Downloadsweekly downloads

1

version

1.0.4

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability