Skip to content

selectRandomVariation

Jason Godesky edited this page Jul 24, 2026 · 1 revision

selectRandomVariation returns one randomly-chosen variation from a string of slash-separated options.

Parameters

variations: string

A string of slash-separated options to randomly choose from.

Returns

One of the options, chosen randomly.

Examples

import { selectRandomVariation } from '@revolutionarygamesco/common'

selectRandomVariation('to-MAY-to / to-MAH-to') // Either 'to-MAY-to' or 'to-MAH-to'

Clone this wiki locally