Skip to content

Commit 4b5348a

Browse files
committed
Add examples with if statements to 18.8
1 parent d276b0c commit 4b5348a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,19 +1530,23 @@ Other Style Guides
15301530
}
15311531

15321532
// also bad
1533-
function bar() {
1533+
if (baz) {
15341534

1535+
console.log(qux);
1536+
} else {
15351537
console.log(foo);
1538+
15361539
}
15371540

1538-
// still bad
1541+
// good
15391542
function bar() {
15401543
console.log(foo);
1541-
15421544
}
15431545

15441546
// good
1545-
function bar() {
1547+
if (baz) {
1548+
console.log(qux);
1549+
} else {
15461550
console.log(foo);
15471551
}
15481552
```

0 commit comments

Comments
 (0)