Skip to content

Returns a random value from an array removing it from the array (or undefined if the array is empty)

Notifications You must be signed in to change notification settings

rojo2/random-take

Repository files navigation

Random Take

Travis CI

import randomTake from "@rojo2/random-take";

const listOfNumbers = [1,2,3,4];
const number = randomTake(listOfNumbers); // random value from listOfNumbers 

IMPORTANT: The difference between this and random-pick is that this function removes the element from the array while random-pick doesn't.

Made with ❤️ by ROJO 2 (http://rojo2.com)

About

Returns a random value from an array removing it from the array (or undefined if the array is empty)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published