Skip to content

Instantly share code, notes, and snippets.

@wudi
Created October 13, 2014 09:42
Show Gist options
  • Save wudi/eb9d32c3ec7b732b4384 to your computer and use it in GitHub Desktop.
Save wudi/eb9d32c3ec7b732b4384 to your computer and use it in GitHub Desktop.
JS 生成范围内随机整数
var randNum = function (min, max) {
return parseInt(Math.random() * (max - min + 1) + min, 10);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment