Switch statements
Learn how to execute selective instructions using switch statement.
There is an abbreviated version for a long chain of if-else statement: the switch
operator. Switch is like a telephone operator. It puts you through some code in case the correct value is stored in your variable. There is also a default line, saying “the number you have dialed is invalid”.
Access this course and 1400+ top-rated courses and projects.