Math.random(num = 1)

What I'd really like to see is a more full-fledged random API for JavaScript. So, you'd have functions like randomInt(start, end), randomFloat(start, end), randomBoolean(), maybe you can even have different randomFloat() functions that generate numbers over configurable distributions. The ability to seed multiple independent generators would be nice as well.

I had started a bit of a discussion around this in the past: A more complete random API?

5 Likes