Skip to content
On this page

randomChance

Rolls an n-sided die.

Usage

ts
import { randomChance } from '@screaming/utils'

randomChance(10)
// returns true 1 in 10 times
1
2
3
4

Type Definitions

ts
/**
 * @param n - The number of sides on the die.
 * @returns If the die roll was 0.
 */
export declare function randomChance(n: number): boolean
1
2
3
4
5