Re:No ifs...alternatives to statement branching in JavaScript
by gruseom on Saturday August 07, 2010 @11:49AM
(#1583732)
But that crashes on null in all three languages, no? (i.e. if evt is null and window.event is non-null.) I suppose you could do this:
But that's probably more trouble than it's worth. Anyway, I agree with you in preferring expressions to statements on the whole. It's hard to imagine why anyone would prefer the more than 4x as long version in the OP; to me it reads like a parody.
[ Parent
| on HN ]