4 ms·
Is the Math.random() complaint really true? Great read anyway. I normally dismiss anything labeled "growth hacking" as snake oil but this was really interestin
by Kiro 13y ago
Is the Math.random() complaint really true?
Great read anyway. I normally dismiss anything labeled "growth hacking" as snake oil but this was really interesting.
- ricardobeat 13y agoMath.random() in modern browsers is a pretty good RNG. He would probably be happier with a pseudo-random algorithm or simple rotation, but over time a uniform distribution should be seen if his code is correct: http://coffeescript.org/#try:alert%20%5B0..300%5D.reduce%20(p%2Cc%2Ci)%20-%3E%0A%20%20%20%20%2B%2Bp%5BMath.floor(Math.random()%20*%203)%5D%3B%20p%0A%2C%20%5B0%2C0%2C0%5D http://coffeescript.org/#try:alert%20%5B0..300%5D.reduce%20(...