[Laszlo-dev] Confusing idiom: 'foo' in bar && bar['foo']

P T Withington ptw at pobox.com
Fri Mar 21 05:43:11 PDT 2008


I'm not sure how this got started:

   'foo' in bar && bar['foo']

but it is overly-complicated.  If 'foo' is not `in bar`, then  
`bar['foo']` will evaluate to undefined (and be false), so the first  
test is superfluous.

[Filed as LPP-5660]


More information about the Laszlo-dev mailing list