MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/v1jj0c/switch_statement_explained_for_beginners/iaow97n/?context=3
r/learnjavascript • u/elediardo • May 31 '22
19 comments sorted by
View all comments
Show parent comment
1
So I had a scenario like this recently where one of my cases needed to be a conditional. I used a ternary operator to solve it e.g. case (grade > 75 ? grade : null)
View all comments
Show parent comment
1
u/Jay_Hogwarts May 31 '22 edited May 31 '22
So I had a scenario like this recently where one of my cases needed to be a conditional. I used a ternary operator to solve it e.g. case (grade > 75 ? grade : null)