Thought I'd mention this has been discussed before:

- https://esdiscuss.org/topic/existential-operator-null-propagation-operator
- https://esdiscuss.org/topic/the-existential-operator
-
https://esdiscuss.org/topic/optional-chaining-aka-existential-operator-null-propagation
- https://esdiscuss.org/topic/proposal-for-a-null-coalescing-operator
- https://esdiscuss.org/topic/operator-was-es6-doesn-t-need-opt-in

Currently, here's what I've seen emerge out of these discussions as the
most likely, each of them chainable:

1. `x ?? y` for `x != null ? x : y`
2. `x??y` or `x?.y` for `x != null ? x.y : undefined`

In #2, the operator works similarly for computed access, function calls,
etc., like in `f?.(x)` equivalent to `f != null ? f(x) : undefined`

On Tue, May 10, 2016, 08:50 Bruno Jouhier <bjouh...@gmail.com> wrote:

> `??=` is cleaner and avoids problems when the default is falsy but not
> undefined. But then we also need `??`.
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to