[Laszlo-dev] Confusing idiom: 'foo' in bar && bar['foo']
Henry Minsky
henry.minsky at gmail.com
Fri Mar 21 05:58:00 PDT 2008
What if they mean
'foo' in bar && bar['foo'] != null
?
On Fri, Mar 21, 2008 at 8:43 AM, P T Withington <ptw at pobox.com> wrote:
> 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]
>
--
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080321/0ed3dc4c/attachment.html
More information about the Laszlo-dev
mailing list