Namespace Random

Totally rando.

Numbers

  • float Random floating point number within a given range
  • integer Random whole number within a given range Arrays
  • arrayElement Random item from an array (alias of Arrays.randomElement)
  • arrayIndex Random index of an array (alias of Arrays.randomIndex)

Time

  • minutesMs Random range of minutes, value in milliseconds
  • secondsMs Random range of seconds, value in milliseconds

Weighted random numbers:

More

  • hue Random hue - 0..359 number (alias of Visual.Colour.randomHue)
  • string Random string made up of letters and numbers
  • shortGuid Quasi-unique id generator

Example: Importing (with aliasing)

// If library is stored two directories up under `ixfx/`
import {hue as randomHue, string as randomString} from '../../ixfx/dist/random.js';
// Import from web
import {hue as randomHue, string as randomString} from 'https://unpkg.com/ixfx/dist/random.js'

References

Renames and re-exports randomElement
Renames and re-exports randomIndex
Renames and re-exports randomHue
Renames and re-exports randomUniqueInteger
Renames and re-exports random