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 <[email protected]> wrote:

> I prefer `u || 0`
>
> On Thu, 21 Dec 2017 at 13:56 Sebastian Cholewa <
> [email protected]> 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
>> [email protected]
>> https://mail.mozilla.org/listinfo/es-discuss
>>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to