Conceptual - what prevents Math.floor(Math.random() * 2) from = 2?


#1



conceptual - what prevents Math.floor(Math.random() * 2) from = 2?


Replace this line with your code.


#2

well, math random generates a random number between 0 and 1, 0 and 1 not included. I am not sure how many decimals, but lets say the highest number is .999999, multiply it by two, you will have 1.999998, if you floor this number. You will get 1. It is impossible to get 2


#3

ahh I didn't realize 1 wasn't included. thanks!