Which method is faster or more responsive in javascript, if-else, the ternary operator or logical OR? Which is advisable to use, for what reasons?
to charlie roberts' answer above, I would add:
the following link gives some incisive answers; the result for switches in Firefox being the most striking: http://jsperf.com/if-else-vs-arrays-vs-switch-vs-ternary/39
Those who question why anyone would investigate optimization to this degree would do well to research WebGL!