Merge pull request #717 from ibdul/js-ternary

feat: add improved comments to js ternary op
This commit is contained in:
Fechin authored and GitHub committed 2025-09-02 15:05:31 +08:00
commit 7abba95911
1 file changed
+3 -1
+3 -1
View File
@@ -152,9 +152,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;
```