UNPKG

just-random

Version:

return a randomly selected element in an array

26 lines (18 loc) 605 B
<!-- DO NOT EDIT THIS FILE! THIS FILE WAS AUTOGENERATED BY TEMPLATE-MATE --> <!-- SEE https://github.com/angus-c/just/blob/master/CONTRIBUTING.md#readme-template --> ## just-random Part of a [library](https://anguscroll.com/just) of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion. [`🍦 Try it`](https://anguscroll.com/just/just-random) ```shell npm install just-random ``` ```shell yarn add just-random ``` Return a randomly selected element in an array ```js import random from 'just-random'; random([1, 2, 3]); // one of [1, 2, 3], at random ```