Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

bool

import { bool } from "https://git.sr.ht/~ruivieira/deno-experiments/blob/master/randomjs/mod.ts";

Returns a boolean Distribution with 50% probability of being true or false

function bool(): Distribution<boolean>;
function bool(percentage: number): Distribution<boolean>;
function bool(numerator: number, denominator: number): Distribution<boolean>;
function bool(numerator?: number, denominator?: number): Distribution<boolean>;
§
bool(): Distribution<boolean>
[src]

Returns a boolean Distribution with 50% probability of being true or false

§Return Type

§
bool(percentage: number): Distribution<boolean>
[src]

Returns a boolean Distribution with the provided percentage of being true

§Parameters

§
percentage: number
[src]

A number within [0, 1] of how often the result should be true

§Return Type

§
bool(numerator: number, denominator: number): Distribution<boolean>
[src]

Returns a boolean Distribution with a probability of numerator divided by denominator of being true

§Parameters

§
numerator: number
[src]

The numerator of the probability

§
denominator: number
[src]

The denominator of the probability

§Return Type

§
bool(numerator?: number, denominator?: number): Distribution<boolean>
[src]

§Parameters

§
numerator?: number optional
[src]
§
denominator?: number optional
[src]

§Return Type