A switch statement is better when you want to do something different based on a single property... This is better, shorter, more readable (and faster to run) than the equivalent if/else block... However, the switch statement does only work on a single comparison, so you need to use an if/else block if you want to compare different things or combination of things.