Skip to content

Commit 8ed1924

Browse files
eduardbarljharb
authored andcommitted
[readme] use single quotes in nested ternary bad example (section 15.6)
The bad example in section 15.6 (nested ternaries) used double-quoted string literals ('"bar"', '"baz"'), which contradicts section 6.1 of this same style guide that requires single quotes. Also related to issue #3152 which flagged inconsistent style conventions in code examples across sections. Fixes the bad example to use single-quoted strings consistently with the rest of the guide and with the good examples immediately below.
1 parent ce3f8e9 commit 8ed1924

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,8 +2133,8 @@ Other Style Guides
21332133
```javascript
21342134
// bad
21352135
const foo = maybe1 > maybe2
2136-
? "bar"
2137-
: value1 > value2 ? "baz" : null;
2136+
? 'bar'
2137+
: value1 > value2 ? 'baz' : null;
21382138
21392139
// split into 2 separated ternary expressions
21402140
const maybeNull = value1 > value2 ? 'baz' : null;

0 commit comments

Comments
 (0)