Sorry I wasn't paying much attention.
Math.random will never return 1. It returns random number between 0 and 1. It may return 0 but 1 is not included. So your if statement will always fall into the else clause