@jossmac/lil-libs
    Preparing search index...

    Function randomInteger

    • Generates random integers in an inclusive range.

      Both bounds are inclusive. Reversed bounds are automatically normalised.

      • min: number

        Lower bound (inclusive); swapped with max when out of order.

      • max: number

        Upper bound (inclusive); swapped with min when out of order.

      A uniformly random integer in [min, max].

      randomInteger(1, 3); // 1, 2, or 3
      randomInteger(3, 1); // same as randomInteger(1, 3)