It performs the same function as the else if statement in the last lesson. It basically deals with multiple scenarios and tests various conditions.
A condition in a switch statement is refered to as a CASE. If case is true-execute a block of code, if it is False see if any other case is true. If any other case is true, execute a block of code, repeat the process until find a true case / condition.
If none of the cases mentioned are true, will tell the browser what to do by using simply DEFAULT. default performs the same function as else.
A condition in a switch statement is refered to as a CASE. If case is true-execute a block of code, if it is False see if any other case is true. If any other case is true, execute a block of code, repeat the process until find a true case / condition.
If none of the cases mentioned are true, will tell the browser what to do by using simply DEFAULT. default performs the same function as else.
Aucun commentaire:
Enregistrer un commentaire