To Remember – Math.floor


youHit to Math.floor(Math.random() * 2). This sets youHit to a random number that’s either 0 (which JavaScript reads as false) or 1 (which JavaScript reads as true).

Source Codecademy

Read more "To Remember – Math.floor"