-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #778 from mate-academy/solaryasha-patch-1
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
1. [CODE STYLE] - Don't nest ternary operators. Write one, you can do this, we believe in you ! | ||
2. [CODE STYLE] - You don't need to name functions if you return them right away. | ||
|
||
BAD EXAMPLE: | ||
``` | ||
function a() { | ||
return function b() { | ||
console.log('Hello'); | ||
} | ||
} | ||
``` | ||
|
||
GOOD EXAMPLE: | ||
``` | ||
function a() { | ||
return function () { | ||
console.log('Hello'); | ||
} | ||
} | ||
``` | ||
|
||
|
||
4. [CODE STYLE] - You should use one variable for counting function calls | ||
5. [CODE STYLE] - DRY. When you do similar logic, try to combine conditions |