Skip to content

draw

Get a random item from a list

155 bytes

Usage

Draw, as in ‘to draw a card from a deck’, is used to get a random item from an array.

import * as _ from 'radashi'
const fish = ['marlin', 'bass', 'trout']
_.draw(fish) // => a random fish