Created
February 23, 2016 02:51
-
-
Save kurozumi/14bebe73995b56798c36 to your computer and use it in GitHub Desktop.
【javascript】指定した範囲内でランダムに数字を取得する関数
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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