Switch or if, else if, else?
Post a Reply
|Oldest Newest Rating|
· December 23, 2015
Did you try looking for an answer to this question before asking it?
If so, perhaps you could have put a little bit more effort into thinking about keywords.
You can help save the internet (and your fingers, think about how I used less keystrokes in my keywords) by making an effort to reduce the amount of redundant information it contains. GOOGLE before you ask.
· December 26, 2015
The functionality is the same, it's just a conditional statement that checks if something is true and then if it is runs something.
The only real difference is that switch statements are slightly cleaner in terms of being 'visually pleasing' rather than a bunch of if statements with a shed load of curly braces etc