re: Why switch is better than if-else VIEW POST

FULL DISCUSSION
 

I didnt get to point out but I'm glad you did in your article that the best way to format a switch statement is indented.

switch (x) {
  case 0: {
    func();
  }
  case 1: {
    func2();
  }
  ..
}
code of conduct - report abuse