freeCodeCamp's Introducing Else and Else If Statements, Chaining If Else If Statements (11)

Lesson Summary

In this freeCodeCamp tutorial video we are back at it in our Basic Javascript course. In this video we look at the following lessons: Introducing Else Statements, Introducing Else If Statements, Logical Order in If Else Statements, & Chaining If Else Statements We learned in the past videos about If Statements and how we can specify a condition to be true in order for our If Statement to run. But when the If statement is false the code never runs. What if we wanted to add another condition to chec for? We can do this with the Else Statement. If we add the keyword right after our If Statement we can alternatively run another piece of code when the If statment is false. If we want more than to conditions we can chain multiple If Statements using Else If statements. We learned about the importance of putting our conditions in the right order. Not doing so will cause a condition to trigger true before the desired condition. Mastering conditional logic is key on your journey through the world of coding.

Subscribe To Monthly Newsletter. Chance to Win Monthly Prizes

* indicates required