There are many unpleasant things about using switch: the procedural control flow, the non-standard syntax of code blocks – in javascript, curly braces are used as standard, in the switch construct they are not. In general, switch syntax is not the best example of javascript. We have to manually add a break for each case, which can make it hard to debug errors later, and if we forget a break somewhere, it triggers errors in subsequent case cases. Douglas Crockford has written and talked about this many times; he recommends using switch with caution.
In javascript we often use objects for all sorts of things, including things we wouldn’t dream of using switch. So why not use an object literal instead of the switch? It would make our code more flexible, readable, maintainable, and we wouldn’t have to manually add break to our cases! It also makes it easier for newbies to work, since they are standard objects.
As the number of cases increases, the performance of objects (hash tables) becomes better than the switch construct (where consistency of cases is important). The object approach is a hash table lookup, and the switch construct has to evaluate each case until it finds a match and break.