%20Re%3A%20Looking%20for%20Champion%3A%20Null%20Coalescing%20%28%3F%3F%29%20and%20Null%20Conditional%0A%09Member%20Access%20%28%3F.%29%20operators&In-Reply-To=%3CCAAuY5VfQ7bDx%3D3LVPsNf78jbDFHqYkK%2BQgMui9EgsqQOSQ0%3DKw%40mail.gmail.com%3E

Michael Rosefield rosyatrandom at gmail.com
Thu Dec 21 12:34:57 UTC 2017


Yes, but that conflates falsey values; `??` *should* be about recognising
whether values *exist*, not whether they are *truthy*.

On Thu, 21 Dec 2017 at 12:20 Naveen Chawla <naveen.chwl at gmail.com> wrote:

> I prefer `u || 0`
>
> On Thu, 21 Dec 2017 at 13:56 Sebastian Cholewa <
> sebastian.cholewa at interia.eu> wrote:
>
>> It’s still longer than `??` but instead of:
>>
>> `(u !== undefined && u !== null) ? u : 0`
>>
>> one can use:
>>
>> `u != null ? u : 0`
>>
>>
>>
>>
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171221/3eee5253/attachment.html>


More information about the es-discuss mailing list