Skip to content

Commit 2aa4f5f

Browse files
docs: no-constant-condition: Add multi-comparison example (#16776)
* docs: Add multi-comparison example to no-constant-condition * Merge new example into existing code blocks
1 parent 40287db commit 2aa4f5f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

docs/src/rules/no-constant-condition.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ do {
7474
} while (x = -1);
7575

7676
var result = 0 ? a : b;
77+
78+
if(input === "hello" || "bye"){
79+
output(input);
80+
}
7781
```
7882

7983
:::
@@ -102,6 +106,10 @@ do {
102106
} while (x);
103107

104108
var result = x !== 0 ? a : b;
109+
110+
if(input === "hello" || input === "bye"){
111+
output(input);
112+
}
105113
```
106114

107115
:::

0 commit comments

Comments
 (0)