Skip to content

Instantly share code, notes, and snippets.

@rumblestrut
Created December 29, 2014 17:15
Show Gist options
  • Select an option

  • Save rumblestrut/12dbcfc45874f29a3322 to your computer and use it in GitHub Desktop.

Select an option

Save rumblestrut/12dbcfc45874f29a3322 to your computer and use it in GitHub Desktop.
Random number generator (1 to 10)
var bigDecimal = Math.random();
var improvedNum = (bigDecimal * 10) + 1;
var randomNumber = Math.floor(improvedNum);
alert(randomNumber);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment