Random Number (Integer) Generator

/ Published in: JavaScript
Save to your folder(s)

Simple function to return a value between the minValue and the maxValue.

Copy this code and paste it in your HTML
  1. // Random integer between
  2. function randomIntegerBetween(minValue,maxValue){
  3. return Math.floor(Math.random() * (maxValue - minValue + 1)) + minValue;
  4. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.