Returns a random boolean value based on the given probability.
Optional
A number between 0 and 1 representing the probability of returning true.
true
true with the given probability, otherwise false.
false
randomBool(); // ~50% chance of returning truerandomBool(0.9); // ~90% chance of returning truerandomBool(0.1); // ~10% chance of returning true Copy
randomBool(); // ~50% chance of returning truerandomBool(0.9); // ~90% chance of returning truerandomBool(0.1); // ~10% chance of returning true
Returns a random boolean value based on the given probability.