In life, we make decisions based on circumstances. Think of an everyday decision as mundane as falling asleep — if we are tired, we go to bed, otherwise, we wake up and start our day.

These if-else decisions can be modeled in code by creating conditional statements. A conditional statement checks a specific condition(s) and performs a task based on the condition(s).

In this lesson, we will explore how programs make decisions by evaluating conditions and introduce logic into our code!

We’ll be covering the following concepts:

  • if, else if, and else statements
  • comparison operators
  • logical operators
  • truthy vs falsy values
  • ternary operators
  • switch statement

So if you’re ready to learn these concepts go to the next lesson— else, read over the concepts, observe the diagram, and prepare yourself for this lesson!


Check out the diagram to see how conditionals allow us to create decision-making technology.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?