DEV Community

Discussion on: What is your pettiest programming-related opinion?

 
hyftar profile image
Simon Landry

Switch cases are syntactic sugar for writing repetitive if and else if statements, not a language feature. Just like the for loop, you could write a while loop that does exactly the same thing.