Existential Operator / Null Propagation Operator

Tingan Ho tingan87 at gmail.com
Wed Aug 19 09:01:58 UTC 2015

I don't see the redundancy? In my proposal the original proposed symbol `?`
is switched with `!`. So it shouldn't throw any error?

On Wed, Aug 19, 2015 at 4:42 PM, Isiah Meadows <isiahmeadows at gmail.com>

> -1 for the `!` idea. It feels redundant to me, since if you try calling an
> undefined value, it'll throw errors at you. It doesn't seem to insure
> anything extra beyond current behavior.
> On Wed, Aug 19, 2015, 02:27 Tingan Ho <tingan87 at gmail.com> wrote:
>> One thing to keep in mind is that with prefix operator `?a.b` will also
>> let people move back and forth with their caret. Since most people type the
>> identifier first and then the operator. So they type `a` first and the move
>> the caret in front of `a` and type `?` and then move the caret back to the
>> last position and then type `.b`. This has been a big problem in typing
>> type assertions in TS which had a prefix operator. They later introduced
>> the `as` operator which is a postfix operator.
>> What about `a!?.b` since semantically the symbol `!` has a meaning of
>> non-nullable in JSDoc[1]. So the semantics of  `a!?.` is `is it not null
>> then the accessor ...`.
>> Or just `a!.b`?
>> [1]: Non-nullable type — http://usejsdoc.org/tags-type.html
>> --
>> Sincerely,
>> Tingan Ho
>> @tingan87 <https://twitter.com/tingan87>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss


Tingan Ho
@tingan87 <https://twitter.com/tingan87>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150819/67826f03/attachment.html>

More information about the es-discuss mailing list