Can the Math.random() command actually return a 0 or 1? - CodingForums.com:

Can the Math.random() command actually return a 0 or 1?


Fun thread. TL;DR: 0 yes, but more likely you win the lottery. 1 never, except for Safari and Opera in 2002, both of which screwed up their implementation of Math.random(). So if you get a one, it's not exactly your fault.

(Strangely, those two browsers gave 1 something reportedly like 1 in 35,000 runs, which is unbelievably often.)

Labels: