Created
May 23, 2018 13:54
-
-
Save sagardere/0006c223b901fa29292e289fba5478f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In switch statements if you are not add break statements | |
// after the end of case statements then all cases are executed by defaults | |
var number = 3; | |
switch(number){ | |
case 1: | |
console.log("The number is one"); | |
break; | |
case 2: | |
console.log("The number is two"); | |
break; | |
case 3: | |
console.log("The number is three"); | |
break; | |
default : | |
console.log("The number is : " + number); | |
break; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment