control-statement--value-selection 2

This commit is contained in:
Gil Birman
2018-02-08 13:07:34 -08:00
committed by GitHub
parent 16190d8cb5
commit c8b1164105

View File

@@ -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