npm.io
4.0.1 • Published 5 years ago

random-item

Licence
MIT
Version
4.0.1
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
58

random-item

Get a random item from an array

Install

$ npm install random-item

Usage

import randomItem from 'random-item';

randomItem(['🐴', '🦄', '🌈']);
//=> '🦄'

randomItem.multiple(['🐴', '🦄', '🌈'], 2);
//=> ['🌈', '🦄']

Keywords