fix(curriculum): revise intro "Selecting from Many Options with Switch Statements" (#50000)

This commit is contained in:
Gaurav Nainwal
2023-04-08 14:52:17 +05:30
committed by GitHub
parent e1dd1a5726
commit c0eb4e6fac

View File

@@ -9,7 +9,7 @@ dashedName: selecting-from-many-options-with-switch-statements
# --description--
If you have many options to choose from, use a <dfn>switch</dfn> statement. A `switch` statement tests a value and can have many <dfn>case</dfn> statements which define various possible values. Statements are executed from the first matched `case` value until a `break` is encountered.
If you need to match one value against many options, you can use a <dfn>switch</dfn> statement. A `switch` statement compares the value to the <dfn>case</dfn> statements which define various possible values. Any valid JavaScript statements can be executed inside a <dfn>case</dfn> block and will run from the first matched `case` value until a `break` is encountered.
Here is an example of a `switch` statement: