Skip to content

Commit eaa3477

Browse files
authored
Lower "bad example" count
-The section, "Use default arguments instead of short circuiting or conditionals" originally had 2 "bad examples" and 1 "good example." - This commit lowers the "bad examples" count from 2 -> 1. - The 1st "bad example" demonstrated the "conditionals" approach to default values. - The 2nd "bad example" demonstrated the "short-circuit" approach to default values. - I decided to only show the "short-circuit" approach as the 1 bad example, since that's what most people would use traditionally in ES5. - Few people actually use the "conditionals" approach, so I felt that warning against the "conditionals" approach was unnecessary.
1 parent ac12cb8 commit eaa3477

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

README.md

-13
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,6 @@ function paintCar(car) {
173173

174174
### Use default arguments instead of short circuiting or conditionals
175175

176-
**Bad:**
177-
```javascript
178-
function createMicrobrewery(name) {
179-
let breweryName;
180-
if (name) {
181-
breweryName = name;
182-
} else {
183-
breweryName = 'Hipster Brew Co.';
184-
}
185-
...
186-
}
187-
```
188-
189176
**Bad:**
190177
```javascript
191178
function createMicrobrewery(name) {

0 commit comments

Comments
 (0)