Created
July 23, 2015 10:47
-
-
Save heyalexej/5ad729db6f3711c36116 to your computer and use it in GitHub Desktop.
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
// var s = document.createElement('script'); | |
// s.type = 'text/javascript'; | |
// // s.async = true; | |
// if (my fancy sampling condition) { | |
// js.src = "//remote-domain.com/script-1.js"; | |
// } else { | |
// js.src = "//remote-domain.com/script-2.js"; | |
// } | |
// document.head.appendChild(s); | |
function lol() { | |
var random = Math.random(); | |
if (random < 0.5) { | |
console.log('chance 0.0-0.499'); | |
} else if (random < 0.75) { | |
console.log('chance 0.50—0.7499'); | |
} else { | |
console.log('chance 0.75–0.99'); | |
} | |
} | |
var i = 0; | |
while (i < 10000) { | |
// 10K durchläufe | |
lol(); | |
i++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment