Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created February 23, 2016 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurozumi/14bebe73995b56798c36 to your computer and use it in GitHub Desktop.
Save kurozumi/14bebe73995b56798c36 to your computer and use it in GitHub Desktop.
【javascript】指定した範囲内でランダムに数字を取得する関数
rand(min, max){
var offset = min;
var range = (max - min) + 1;
var randomNumber = Math.floor( Math.random() * range) + offset;
return randomNumber;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment