We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e16b03b commit 3ad1ad1Copy full SHA for 3ad1ad1
README.md
@@ -1914,16 +1914,15 @@ Other Style Guides
1914
? "bar"
1915
: value1 > value2 ? "baz" : null;
1916
1917
- // better
+ // split into 2 separated ternary expressions
1918
const maybeNull = value1 > value2 ? 'baz' : null;
1919
1920
+ // better
1921
const foo = maybe1 > maybe2
1922
? 'bar'
1923
: maybeNull;
1924
1925
// best
- const maybeNull = value1 > value2 ? 'baz' : null;
1926
-
1927
const foo = maybe1 > maybe2 ? 'bar' : maybeNull;
1928
```
1929
0 commit comments