Creates a random number.
You specify the length of the number.
npm install random-int-generator
Create a global variable.
const num = require('random-int-generator');
You specify the length of the number as parameter.
This example will give you a 5 digit number.
let randomNumber = num.getRandomNumber(5);
console.log(randomNumber);
Output:
The output is a random number, everytime you invoke the funktion the number will be different.
In this example we specified a 5 digit number.
If we want for example a 3 digit number, we call the function with the parameter 3.
83151