util-number

Methods

(inner) getRandomNumber(n) → {number}

Generates a random number of n|n-1 digits
Parameters:
Name Type Description
n number specify digits in the output
Since:
  • 0.0.2
Source:
Example
// returns 24378
getRandomNumber(5);
// returns 2993241219
getRandomNumber(10);

(inner) getRandomNumberBetween(min, max) → {number}

Generates a random number between min and max range
Parameters:
Name Type Description
min number the lower range (including it)
max number the upper range (including it)
Since:
  • 0.0.2
Source:
Example
// returns 8
getRandomNumberBetween(1, 8);
// returns 23
getRandomNumberBetween(10, 30);
// returns 23
getRandomNumberBetween(23, 28);