From f9db5fe54c29ca8d68811a8e35fbecd348cd01be Mon Sep 17 00:00:00 2001 From: Vladimir Zhelvis Date: Thu, 9 Feb 2023 23:00:00 +0200 Subject: [PATCH] Update control section guide --- JavaScript/Javascript.md | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/JavaScript/Javascript.md b/JavaScript/Javascript.md index 546a554..2695a1e 100644 --- a/JavaScript/Javascript.md +++ b/JavaScript/Javascript.md @@ -1730,37 +1730,22 @@ Heavily inspired by and partly composed of [Airbnb JavaScript Style Guide // bad if (foo === 123 && - bar === 'abc') { - thing1(); - } - - // bad - if (foo === 123 - && bar === 'abc') { - thing1(); - } - - // bad - if ( - foo === 123 && - bar === 'abc' + bar === 'abc' ) { thing1(); } // good - if ( - foo === 123 - && bar === 'abc' + if (foo === 123 + && bar === 'abc' ) { thing1(); } // good - if ( - (foo === 123 || bar === 'abc') - && doesItLookGoodWhenItBecomesThatLong() - && isThisReallyHappening() + if ((foo === 123 || bar === 'abc') + && doesItLookGoodWhenItBecomesThatLong() + && isThisReallyHappening() ) { thing1(); }