I have researched some other ways to create random boolean and understood the concepts behind them but I need help explaining Math.random() > .2.
Why is it .2 instead of just 2? Thank you.
It is because Math.random() can return any value between 0 and 1, so there is a roughly 50/50 chance that the result will be above or below 0.5.
I now see why Math.random() > 2 will not make sense…
I still do not understand what .2 means. I could not find the answer from Google. It is not 0.2 is it?
If there is a 50/50 chance that Math.random() will return a number greater than or equal to 0.5, then what are the odds it will return a number greater than or equal to 0.2?