Nefariously Programmed Mecha

    random-item
    TypeScript icon, indicating that this package has built-in type declarations

    4.0.1 • Public • Published

    random-item

    Get a random item from an array

    Install

    $ npm install random-item
    

    Usage

    import randomItem from 'random-item';
    
    randomItem(['🐴', '🦄', '🌈']);
    //=> '🦄'
    
    randomItem.multiple(['🐴', '🦄', '🌈'], 2);
    //=> ['🌈', '🦄']

    Related

    Install

    npm i random-item

    DownloadsWeekly Downloads

    28,236

    Version

    4.0.1

    License

    MIT

    Unpacked Size

    3.91 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar