Loading
Current section: 4. Control Flow 8 exercises
Problem

Switch Statements

Loading exercise

Transcript

00:00 Let's get into, switch statements. This is another control flow, feature of JavaScript and many other languages. And effectively, what this is is in our if else example, we were basically just saying, the score, and and every single one of our if statements was evaluating whether the score was greater than or equal to some value. Switch statements are, kind of specially catered to that type of, scenario. So here's the value.

00:29 And in this in the case that it's this, then do this. In the case that it's this, then do this, etcetera, etcetera. So if statement's definitely more powerful. Switch statements, are a little bit more niche, but, very useful and a little bit easier to read in some cases as well. So you're definitely going to run into them in the real world, and so we're gonna learn about them in this exercise.

00:48 I'll leave you to it. We'll see you when you're done.