From c8b1164105064b7786b24258f53f6237fb4bdd15 Mon Sep 17 00:00:00 2001 From: Gil Birman Date: Thu, 8 Feb 2018 13:07:34 -0800 Subject: [PATCH] control-statement--value-selection 2 --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index ee02c0e9..556e874c 100644 --- a/README.md +++ b/README.md @@ -2175,6 +2175,20 @@ Other Style Guides } ``` + + - [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