codetrix - v1.5.0
    Preparing search index...

    Function randomByDigits

    • Generates a random integer with the specified number of digits.

      Parameters

      • digits: number

        The number of digits for the random number. Must be greater than 0.

      Returns number

      A random integer with the specified digit length.

      Will throw an error if digits is less than or equal to 0.

      randomByDigits(3); // Might return 527