TS-Scribe - v0.6.2
    Preparing search index...

    Function randomBool

    • Returns a random boolean value based on the given probability.

      Parameters

      • Optionalprobability: number = 0.5

        A number between 0 and 1 representing the probability of returning true.

      Returns boolean

      true with the given probability, otherwise false.

      randomBool();         // ~50% chance of returning true
      randomBool(0.9); // ~90% chance of returning true
      randomBool(0.1); // ~10% chance of returning true