Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
646 views

Switch / select case etc. compared to If ... ElseIf ... Else [duplicate]

I don't understand why the switch or equivalent is so popular in languages. To me, it seems like it had a place back in the days when the alternative was lots of nested if statements in the else part ...
neelsg's user avatar
  • 483
8 votes
3 answers
33k views

If statements vs switch cases? in a JavaScript game and if to use a function [duplicate]

I am developing a game in JavaScript where you start with a user input, stored in the variable "controller". The options for the user consists of start to start the game or about to learn about the ...
Ben Watkins's user avatar