Thursday, March 12, 2015

Javascript random number between two numbers

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

console.log(getRandomInt(1,100));

No comments:

Post a Comment