feat: add improved comments to js ternary op

This commit is contained in:
Ibrahim Abdulhameed committed 2025-08-30 18:14:27 +01:00
1 parent 8afb7b16e2
commit 47006ac844
1 file changed
+3 -1
+3 -1
View File
@@ -146,9 +146,11 @@ if (isMailSent) {
### Ternary Operator
```javascript
// The ternary operator is a concise way to write an if-else statement in a single line: condition ? exprIfTrue : exprIfFalse.
var x = 1;
// => true
// true, (condition) ? value_if_true : value_if_false
result = x == 1 ? true : false;
```