random-n

1.0.1 • Public • Published

Build Status Coverage

random-n

🚀 The blazing fast module to get a random collection of n different items from an array.

Install

$ npm i random-n

Usage

import random from 'random-n'
 
random([1, 2, 3, 4, 5], 3)
 
// [3, 2, 5]

random(array, size?)

  • array Array
  • size ?int=array.length The n-size of the collection. If not specified, the length of the array will be used.

Returns Array

License

MIT

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i random-n

    Weekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    4.27 kB

    Total Files

    5

    Last publish

    Collaborators

    • kael