Generate random number between two integers


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

Generate random number between two integers


Copy this code and paste it in your HTML
  1. var lower = 2;
  2. var higher = 10;
  3. var randomNum = Math.round(Math.random() * (higher - lower)) + lower;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.