Proposal for a null coalescing operator

Michael McGlothlin mike.mcglothlin at gmail.com
Mon Aug 17 02:01:27 UTC 2015


In JS it seems it'd be more useful if it worked with undefined not null.

Thanks,
Michael McGlothlin
Sent from my iPhone

> On Aug 16, 2015, at 7:33 PM, Brandon Andrews <warcraftthreeft at sbcglobal.net> wrote:
> 
> https://en.wikipedia.org/wiki/Null_coalescing_operator
> 
> Essentially x ?? y will return x when not null or undefined else it will return y.
> 
> 
> A nice Javascript explanation of the current problems with using || that can cause unforeseen bugs:
> 
> http://stackoverflow.com/a/476445
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list