Returns a random number between lower and upper, inclusive - Node.js Number

Node.js examples for Number:Random Number

Description

Returns a random number between lower and upper, inclusive

Demo Code

random = function (lower, upper) {
  return lower + Math.floor(Math.random()*(upper + 1 - lower))
}

Related Tutorials