Random boolean value
Generates a random boolean value.
Math.random()to generate a random number and check if it is greater than or equal to
const randomBoolean = () => Math.random() >= 0.5;
randomBoolean(); // true
Written by Angelos Chalaris
If you want to keep in touch, follow me on GitHub or Twitter.