Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 6 additions & 21 deletions JavaScript/Javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тогда уж стоит пометить такой пример как плохой

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();
}
Expand Down