Generates a random boolean.
The ratio param is used to determine the chance of the boolean being true or false.
ratio
true
false
For instance:
.5
.1
.9
1
0
A random boolean.
The ratio (between 0 and 1) which the boolean is determined to be true or false. The greater the number, the greater the chance of being true.
Generated using TypeDoc
Generates a random boolean.
The
ratio
param is used to determine the chance of the boolean beingtrue
orfalse
.For instance:
ratio
is.5
, the chance of beingtrue
orfalse
is 50%.ratio
is.1
, the chance of beingtrue
is 10%, and of beingfalse
is 90%.ratio
is.9
, the chance of beingtrue
is 90%, and of beingfalse
is 10%.ratio
is1
or greater, the chance of beingtrue
is 100%.ratio
is0
or lower, the chance of beingtrue
is 0%.Returns
A random boolean.