Function randomInt

  • Get a random integer between the inclusive bounds.

    Parameters

    • Optional lower: number

      The lower bound. (Must be an integer)

    • Optional upper: number

      The upper bound. (Must be an integer)

    Returns number

    Returns a random integer.

    Since

    0.4.2

    Example

    randomInt()
    // => 0 or 1
    randomInt(2)
    // => an integer between 0 and 2
    randomInt(1, 2)
    // => an integer between 1 and 2