These JavaScript exercises introduce you to conditional statements. Conditional statements are important building blocks in every programming language. When developing a piece of software, you often want to execute different pieces of code depending on the input you get.
For example, if a user is logged into an application, you might want to show him his account overview. But, if he is not logged in, you would rather redirect him to the login page. These types of decisions can be written in code using conditionals.
  1. if statement - satisfy condition
  2. if...else statement - run else
  3. if statement - add missing condition
  4. if statement - test multiple conditions
  5. else-if
  6. Conditional (ternary) operator