Re:Using Dispatch Tables to Avoid Conditionals in JavaScript
by mdpye on Monday May 13, 2013 @10:13AM
(#5698734)
I'd prefer to see the functions put in a dictionary and invoked from there rather than named individually in the local scope, easier to see at least what you have to look for when you want to see if they're referenced, and you'd have dict[item] rather than "dict" + item.
Edit: taf2's seems more idiomatic, js is not my first language.
Edit: taf2's seems more idiomatic, js is not my first language.