mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-13 20:57:56 -05:00
Add examples with if statements to 18.8
This commit is contained in:
16
README.md
16
README.md
@@ -1530,13 +1530,10 @@ Other Style Guides
|
||||
}
|
||||
|
||||
// also bad
|
||||
function bar() {
|
||||
if (baz) {
|
||||
|
||||
console.log(foo);
|
||||
}
|
||||
|
||||
// still bad
|
||||
function bar() {
|
||||
console.log(qux);
|
||||
} else {
|
||||
console.log(foo);
|
||||
|
||||
}
|
||||
@@ -1545,6 +1542,13 @@ Other Style Guides
|
||||
function bar() {
|
||||
console.log(foo);
|
||||
}
|
||||
|
||||
// good
|
||||
if (baz) {
|
||||
console.log(qux);
|
||||
} else {
|
||||
console.log(foo);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user