Re:Using Dispatch Tables to Avoid Conditionals in JavaScript
by artificialidiot on Monday May 13, 2013 @10:58AM
(#5699007)
I'd like to see you hunt for the dynamically added case to the dispatch table. Maybe then, you'll change your mind.
There is no fundamental difference between either approaches except the runtime cost. If you need conditonals, use them. If you need a lookup table, use them. Keep the code predictable.
And to top it of, you can dynamically add new commands to the dispatch table which you can't to a switch.