Creating and Constraining Random Numbers - Node.js Number

Node.js examples for Number:Random Number

Description

Creating and Constraining Random Numbers

Demo Code

function randomBetween(min, max) {
  return min + Math.floor(Math.random() * (max - min + 1));
}

Related Tutorials