Get random integer - Node.js Number

Node.js examples for Number:Random Number

Description

Get random integer

Demo Code


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

Related Tutorials