# Ternary Comparison Assignment Operators

**URL:** <https://es.discourse.group/t/ternary-comparison-assignment-operators/943>\
**Category:** 💡 Ideas\
**Created:** [August 23, 2021, 9:53am UTC](https://es.discourse.group/t/ternary-comparison-assignment-operators/943 "2021-08-23T09:53:55Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![willow\_grace](https://avatars.discourse-cdn.com/v4/letter/w/ac8455/32.png) [@willow\_grace](https://es.discourse.group/u/willow_grace)\
**Post date:** [April 27, 2022, 8:52pm UTC](https://es.discourse.group/t/ternary-comparison-assignment-operators/943/9 "2022-04-27T20:52:16Z")

</div>

#### An idea ... Ternary Comparison Assignment Operators with [Negation opperator](https://es.discourse.group/t/negation-opperator/1010)

#### case1.js

```javascript
let value = 10

// check the condition
if (value >= 11) ? value++ : value--; // if pass... increment value++ // if fail ... decrement value

// program to check pass or fail
console.log(`You ${value} the exam.`);

```

#### case2.js

```javascript
let value = 10

// check the condition
if (value >= 11) ? !false : value^^; // if pass... increment value++ // if fail ... decrement value

// program to check pass or fail
console.log(`You ${value} the exam.`);

```

#### Notes

1. Only ideas

---

_[View the full topic](https://es.discourse.group/t/ternary-comparison-assignment-operators/943)._
