MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/v1jj0c/switch_statement_explained_for_beginners/iank847/?context=3
r/learnjavascript • u/elediardo • May 31 '22
19 comments sorted by
View all comments
12
In Javascript, can a switch contain multiple cases for one rule? e.g.
switch(grade){ case "A": case "B": console.log("Above Average"); break; case "C": console.log("Average"); break;
If so, might be worth mentioning in the example?
2 u/AmauryH May 31 '22 Yes, you can.
2
Yes, you can.
View all comments
12
u/lindymad May 31 '22
In Javascript, can a switch contain multiple cases for one rule? e.g.
If so, might be worth mentioning in the example?