||= is much needed?

Brendan Eich brendan at mozilla.com
Fri Jun 15 15:35:08 PDT 2012


Maybe, probably, of course ;-).

I'm still looking for real-world use-cases, code that actually exists 
(in CoffeeScript or JS) that needs to soak up null-or-undefined, not 
just undefined.

/be

John Tamplin wrote:
> On Fri, Jun 15, 2012 at 6:00 PM, Brendan Eich <brendan at mozilla.com 
> <mailto:brendan at mozilla.com>> wrote:
>
>     Can you give a real-world example where null rather than undefined
>     is soaked up? I'm guessing DOM but guessing is bad (cf. Sherlock
>     Holmes).
>
>
> Wouldn't any case where you return null to mean explicitly no object 
> be such a case?  Ie:
>
> var bar = lookupFoo(key)?.bar();
>
> -- 
> John A. Tamplin
> Software Engineer (GWT), Google


More information about the es-discuss mailing list