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

/random-item/

    Package Sidebar

    Install

    npm i random-item

    Weekly Downloads

    23,287

    Version

    4.0.1

    License

    MIT

    Unpacked Size

    3.91 kB

    Total Files

    5

    Last publish

    Collaborators

    • sindresorhus