Control flow

Learn how to make decisions with JavaScript.

StartJavaScript Illustration
Control flow
Lesson 1 of 1
  1. 1

    Now that we've got the parts of JavaScript, let's see what they can do. In this unit, we'll explore how we can take those parts, and create decision trees, games, and much more. In programming, ma...

  2. 2

    If you think about what we've been doing so far, we've been writing instructions for computers. That's all programming really is: a list of instructions for computers. The main difficulty of bein...

  3. 3

    [...] / [...] statements are made even more powerful with comparison operators. There are two comparisons you might be familiar with: - Less than: [...] - Greater than: [...] You may al...

  4. 4

    There are two more extremely useful comparisons we can make. Often times, we might want to check if two things are equal, or if they are not. 1. To check if two things equal each other, we can use...

  5. 5

    [...] / [...] statements are either this or that for us right now. They answer questions that are either yes or no. What can we do if we have a question that has multiple yes conditions, or mult...

  6. 6

    So far, we've been able to translate certain thoughts into JavaScript code, like, "Are these things equal?" with [...] , or, "Is one thing greater than another thing?" with [...] . In English, s...

  7. 7

    Before we move on, let's circle back to [...] statements. Using [...] is a great tool for when we have a few different conditions we'd like to consider. [...] is limited however. If we want...

  8. 8

    Way to go! We just learned a lot of control flow concepts: - [...] / [...] statements make binary decisions and execute separate code based on a condition. - We can add extra conditions with to ...

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo

Control flow

StartJavaScript Illustration