mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-15 04:17:56 -05:00
control-statement--value-selection 2
This commit is contained in:
14
README.md
14
README.md
@@ -2175,6 +2175,20 @@ Other Style Guides
|
||||
}
|
||||
```
|
||||
|
||||
<a name="control-statement--value-selection"></a>
|
||||
- [17.2](#control-statements--value-selection) Don't use selection operators in place of control statements.
|
||||
|
||||
|
||||
```javascript
|
||||
// bad
|
||||
!isRunning && startRunning();
|
||||
|
||||
// good
|
||||
if (!isRunning) {
|
||||
startRunning();
|
||||
}
|
||||
```
|
||||
|
||||
**[⬆ back to top](#table-of-contents)**
|
||||
|
||||
## Comments
|
||||
|
||||
Reference in New Issue
Block a user