Created
March 8, 2016 09:03
-
-
Save ethaizone/c4335a87ea12f00f34b7 to your computer and use it in GitHub Desktop.
Test Math.random() result.
This file contains hidden or 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
var res = {0:0,1:0}; | |
var r; | |
for(var i = 0; i < 100; i++) { | |
r = Math.floor((Math.random() * 2) + 0); | |
res[r]++; | |
} | |
console.log(res); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment