I want to do something if there's a 60% chance (only by using Math.random()). For example, a situation where every value in an array has a 60% chance to be set to 1, otherwise 0.
My confusion is whether we should check
if (Math.random() < 0.6) { ... }
or
if (Math.random() <= 0.6) { ... }
My thought is that it should be the first because 0.0 counts as a possible returned value, but I would like to confirm which one I should use and why.