@kimmel/array-shuffle

1.2.1 • Public • Published

array-shuffle Build Status codecov

Fisher-Yates shuffle of an array of items producing an unbiased permutation.

Install

$ npm install @kimmel/array-shuffle

Usage

import shuffle from '@kimmel/array-shuffle';

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

shuffle does not mutate the original array.

API

shuffle(items)

items

Type: array

['hello', 2, 5, { foo: 'bar' }]

License

MIT © Ryan Castner

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i @kimmel/array-shuffle

    Weekly Downloads

    1

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    3.69 kB

    Total Files

    6

    Last publish

    Collaborators

    • jacobhaug
    • ryanar
    • zackify