Created
May 10, 2023 15:31
-
-
Save suhailgupta03/27e8e87627dc25cfe14ab2b919dc2c02 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
// FOR ALL NUMBERS LESS THAN 5, | |
// I WANT TO PRINT "LESS THAN 5" | |
// FOR ALL NUMBERS GREATER THAN 5, | |
// I WANT TO PRINT "GREATER THAN 5" | |
var y = 2; // Assign y as 2 | |
switch(y) { | |
case 1: | |
case 2: | |
case 3: | |
case 4: | |
console.log("LESS THAN 5"); | |
break; | |
case 6: | |
case 7: | |
case 8: | |
default: | |
console.log("GREATER THAN 5"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment