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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s