Javascript Random number between


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

Uses vars `to` and `from`.


Copy this code and paste it in your HTML
  1. Math.floor(Math.random() * (to - from + 1) + from);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.