# Nullish Ternary Operator

**URL:** <https://es.discourse.group/t/nullish-ternary-operator/1603>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [January 30, 2023, 12:09am UTC](https://es.discourse.group/t/nullish-ternary-operator/1603 "2023-01-30T00:09:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![theScottyJam](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/thescottyjam/32/616_2.png) [@theScottyJam](https://es.discourse.group/u/theScottyJam)\
**Post date:** [January 30, 2023, 4:46am UTC](https://es.discourse.group/t/nullish-ternary-operator/1603/5 "2023-01-30T04:46:28Z")

</div>

[This idea](https://es.discourse.group/t/nullish-unary-operator/657) could also be used to solve this particular use-case. The suggestion there is to introduce a `?` operator, that returns `true` if the input value is not nullish, and `false` otherwise.

You could combine this with the ternary operator to achieve the desired effect:

```javascript
?expression ? expression_if_not_nullish : expression_if_nullish

```

---

_[View the full topic](https://es.discourse.group/t/nullish-ternary-operator/1603)._
