Get a random item from an array
$ npm install random-item
import randomItem from 'random-item';
randomItem(['🐴', '🦄', '🌈']);
//=> '🦄'
randomItem.multiple(['🐴', '🦄', '🌈'], 2);
//=> ['🌈', '🦄']
- random-int - Generate a random integer
- random-float - Generate a random float
- random-obj-key - Get a random key from an object
- random-obj-prop - Get a random property from an object
- unique-random - Generate random numbers that are consecutively unique
- unique-random-array - Get consecutively unique elements from an array
- crypto-random-string - Generate a cryptographically strong random string