1.0.3 • Published 4 years ago

@brightsole/bg-utils v1.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

bg-utils

What are they?

MethodPropsDescription
shuffle(any)Randomly shuffles an array of inputs of any type, very random
selectUniqueRandomsNon-repeatingly selects any number of elements, randomly from an array
arrayToSelectFromthe array of items to randomly pick from
numberToSelectthe number of random selections to make
selectUniqueIndicesNon-repeatingly selects a number of numbers from 0 to max index
numberToSelectthe number of indices to return in an array
maxthe highest number that can be returned

How to use them?

import it, and start using the functions within!

  import { selectUniqueRandoms } from '@brightsole/bg-utils';

  const aFewRandoms = selectUniqueRandoms({ max: 3, numberToSelect: 2 });
  console.log(aFewRandoms);

TODO:

nothing! No plan here, just a bucket to collect random useful methods for consumption elsewhere