Created
May 10, 2023 15:04
-
-
Save suhailgupta03/ad5b33d60be3faf8a2411ddc418b7740 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
var y = 200; // Assign 100 to y | |
switch(y){ // switch is taking 'y' as a value | |
// to validate | |
case 200: // will check if y == 200 | |
console.log("this is 200"); | |
break; // this will exit the switch block | |
case 300: // will check if y == 300 | |
console.log("this is 300"); | |
break; | |
default: // if none of the condition is true | |
// it will execute the default case | |
console.log("This is the default case"); | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment