Conditionals
Learn how to use if, else if, else, switch, and ternary syntax to control the flow of a program in JavaScript.
StartKey Concepts
Review core concepts you need to learn to master this subject
Control Flow
Logical Operator ||
Ternary Operator
else
Statement
Logical Operator &&
switch
Statement
if
Statement
Truthy and Falsy
Control Flow
Control Flow
Control flow is the order in which statements are executed in a program. The default control flow is for statements to be read and executed in order from left-to-right, top-to-bottom in a program file.
Control structures such as conditionals (if
statements and the like) alter control flow by only executing blocks of code if certain conditions are met. These structures essentially allow a program to make decisions about which code is executed as the program runs.
What you'll create
Portfolio projects that showcase your new skills
Magic Eight Ball
It's time to build fluency in JavaScript Fundamentals. In this next Pro Project, we're going to practice Control Flow in Javascript so you can hone your skills and feel confident taking them to the real world. Why? You'll be able to comfortably utilize control flow with if/else or switch statements, as well as logical operators in your conditions. What's next? JavaScript, Control Flow, “It is decidedly so”. You got this!
Race Day
Design the logic for an app that will give runners information on race day!
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory