ds-algo-study
Version:
Just experimenting with publishing a package
12 lines (11 loc) • 328 B
JavaScript
/*
- Returns a random integer within the range `low .. high` inclusive.
-
- parameter: {Number} low
- The lower bound on the range.
- parameter: {Number} high
- The upper bound on the range.
*/
function randomIntInRange(low, high) {
return Math.round(low + (Math.random() * (high - low)));
}