# 'maybe' operator to complement ?? operator

**URL:** <https://es.discourse.group/t/maybe-operator-to-complement-operator/200>\
**Category:** 💡 Ideas\
**Created:** [January 20, 2020, 9:25pm UTC](https://es.discourse.group/t/maybe-operator-to-complement-operator/200 "2020-01-20T21:25:52Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![aclaymore](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/aclaymore/32/501_2.png) [@aclaymore](https://es.discourse.group/u/aclaymore)\
**Post date:** [February 5, 2021, 9:24pm UTC](https://es.discourse.group/t/maybe-operator-to-complement-operator/200/5 "2021-02-05T21:24:49Z")

</div>

The pipeline operator has had a lot of discussion, but that is a good thing. We shouldn't rush things into the language. This idea does come up frequently, so it definitely feels like a problem worth solving. Hopefully someone on the committee agrees.

> [@Optional projection / expression operator - e.g. maybeNullish ?:: transform(maybeNullish)](https://es.discourse.group/t/optional-projection-expression-operator-e-g-maybenullish-transform-maybenullish/572):
>
> Nullish coalescing and optional chaining/evaluation are great, but one analog is still missing-- being able to short-circuit when the nullable value is in an argument position. e.g. in a template string, passed to a function, used with arithmetic operators, etc. Currently still need to use null checks and ternaries like (val !== null && val !== undefined) ? transform(val) : undefined or (x != null && y != null) ? `${x} ${y}` : undefined I'd like to suggest an operator to simplify this pa…

> [@\[syntax\] Inverse null coalescing operator](https://es.discourse.group/t/syntax-inverse-null-coalescing-operator/547):
>
> As there already exists a nullish coalescing operator (??), this implies a use case for an inverse nullish coalescing operator, which would still be a binary operator returning the second operand if the first one is not nullish (in contrast with ??). Sample use-case: when fetching a possibly nullish relation: let retrievedModel: Model | null = idOrNull === null ? null : await database.fetch\<Model\>(idOrNull); // the way it can be achieved now let retrievedModel: Model | null = idOrNull !? await…

---

_[View the full topic](https://es.discourse.group/t/maybe-operator-to-complement-operator/200)._
