Re:Using Dispatch Tables to Avoid Conditionals in JavaScript
by binarymax on Monday May 13, 2013 @10:01AM
(#5698665)
For more complicated scenarios (where you find yourself making trees of conditionals), I suggest reading up on finite state machines, and for js checkout machina:
https://github.com/ifandelse/machina.js