OK, since I'm doing some merging of code in LzNode and LzView, I'll remove superfluous " 'foo' in bar "'s when I encounter them.<br><br><br><br><br><div class="gmail_quote">On Fri, Mar 21, 2008 at 9:23 AM, P T Withington <<a href="mailto:ptw@pobox.com">ptw@pobox.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You still don't need the `'foo' in bar`. If they are testing for non-<br>
nullness, they can still just say:<br>
<br>
bar['foo'] != null;<br>
<br>
The only thing `'foo' in bar` can tell you that `bar['foo']` cannot is<br>
if bar had a 'foo' property whose value was `undefined`. So I think<br>
the `in` test in this idiom is superflous.<br>
<div><div></div><div class="Wj3C7c"><br>
On 2008-03-21, at 08:58 EDT, Henry Minsky wrote:<br>
> What if they mean<br>
><br>
> 'foo' in bar && bar['foo'] != null<br>
><br>
> ?<br>
><br>
><br>
><br>
> On Fri, Mar 21, 2008 at 8:43 AM, P T Withington <<a href="mailto:ptw@pobox.com">ptw@pobox.com</a>> wrote:<br>
><br>
>> I'm not sure how this got started:<br>
>><br>
>> 'foo' in bar && bar['foo']<br>
>><br>
>> but it is overly-complicated. If 'foo' is not `in bar`, then<br>
>> `bar['foo']` will evaluate to undefined (and be false), so the first<br>
>> test is superfluous.<br>
>><br>
>> [Filed as LPP-5660]<br>
>><br>
><br>
><br>
><br>
> --<br>
> Henry Minsky<br>
> Software Architect<br>
> <a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br>