Created
May 10, 2023 15:56
-
-
Save suhailgupta03/eb568c578b28c52ad27a3bd9ddf96322 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 = -2; // assign -2 to y | |
var z = true; | |
switch(z) { // initialze the switch statement | |
// with a number | |
case y < 0: // y < 0 ---> true --> -2 != true | |
console.log("less than 0"); | |
break; | |
case 100: | |
console.log(100); | |
break; | |
case 200: | |
console.log(200); | |
break; | |
default: | |
console.log("The default case"); | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment