Function getRandomInt

  • Generates a random integer within the specified range.

    Parameters

    • min: number = 1

      The minimum value of the range (inclusive). Default is 1.

    • max: number = 10

      The maximum value of the range (inclusive). Default is 10.

    Returns number

    A random integer within the specified range.

    Example

    const randomNum = getRandomInt(5, 20);
    console.log(randomNum); // Random integer between 5 and 20 (inclusive)

Generated using TypeDoc