Existential Operator / Null Propagation Operator

Nick Krempel ndkrempel at google.com
Tue Apr 7 16:55:57 UTC 2015


On 6 April 2015 at 19:33, Christoph Pojer <christoph.pojer at gmail.com> wrote:

> `a?.b` => `(a == null ? void 0 : a.b)`
> `a?.b.c` => `(a == null ? void 0 : a.b.c)`
>

Would it not be more generally useful if it returned "a" rather than "void
0" in the appropriate case, that is:

`a?.b` => `(a == null ? a : a.b)`

This way the notion of nullness/undefinedness the user is working with
would be preserved.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150407/cb6ab056/attachment.html>


More information about the es-discuss mailing list