Wondering what’s next for npm?Check out our public roadmap! »

    array-shuffle
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    array-shuffle

    Randomize the order of items in an array

    Uses the Durstenfeld algorithm based on the Fisher–Yates algorithm.

    Install

    $ npm install array-shuffle
    

    Usage

    const shuffled = arrayShuffle([1, 2, 3, 4, 5, 6]);
    //=> [3, 5, 4, 1, 2, 6]

    API

    arrayShuffle(array)

    array

    Type: array

    The array to shuffle.

    Install

    npm i array-shuffle

    DownloadsWeekly Downloads

    19,054

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    3.02 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar