Introduction

Completed

Some programs that you write execute from top to bottom. Often, you have applications whose paths through the code are determined by different conditions you set up.

Let's say you have a program that wants to create a backup file of all the files in a directory. If the backup file already exists, you don't want to create it again because it could be time consuming. This scenario is an example when you want to be able to express conditional logic so that the code runs differently depending on whether a condition is met or not.

In this module, you'll learn how to work with different operators that you can use to express logic to create multiple paths through your programs.

Learning objectives

In this module, you'll:

  • Review Booleans.
  • Learn about comparison operators.
  • Explore how if and else are used in JavaScript.
  • Discover how to form conditions and make decisions with logical operators.

Prerequisites

None