just-random

return a randomly selected element in an array

Usage no npm install needed!

<script type="module">
  import justRandom from 'https://cdn.skypack.dev/just-random';
</script>

README

just-random

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-random
yarn add just-random

Return a randomly selected element in an array

import random from 'just-random';

random([1, 2, 3]);
// one of [1, 2, 3], at random