Random in range
In this coding challenge, you will be implementing a function called
randomInRange(min, max) that generates a random integer between a given minimum value (inclusive) and a maximum value (exclusive). The function should take two arguments,
max, both of which are integers.
- The minimum value is
inclusiveand the maximum value is
- Assume that this statement is always true
min < max.
Example test cases
const randomInt = randomInRange(1, 10); console.log(randomInt); // output: a random integer between 1 and 9