Skip to content

Instantly share code, notes, and snippets.

@ejke
Created December 1, 2017 12:27
Show Gist options
  • Save ejke/8c8dc94f50e13e57eb4e14a506184c03 to your computer and use it in GitHub Desktop.
Save ejke/8c8dc94f50e13e57eb4e14a506184c03 to your computer and use it in GitHub Desktop.
Math random
// whole nr either 0,1,or 2
Math.floor((Math.random() * (3-0)));
// whole nr either 1,2 or 3
Math.floor((Math.random() * (3-0) + 1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment