Main content

## Logic and if Statements

# Random numbers

Learn how to generate random numbers in ProcessingJS using the random() function, and check their values with if conditions.

If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains ***.kastatic.org** and ***.kasandbox.org** are unblocked.

Main content

Learn how to generate random numbers in ProcessingJS using the random() function, and check their values with if conditions.