We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
else/catch
1 parent 6972e92 commit 10becbaCopy full SHA for 10becba
CodingConvention.md
@@ -87,6 +87,29 @@ if (true)
87
88
Also, notice the use of whitespace before and after the condition statement.
89
90
+Follow the JavaScript convention of stacking `else/catch` clauses on the same line as the previous closing brace.
91
+
92
+*Right:*
93
94
+~~~ {.javascript}
95
+if (i % 2 === 0) {
96
+ console.log('even');
97
+} else {
98
+ console.log('odd');
99
+}
100
+~~~
101
102
+*Wrong:*
103
104
105
106
107
108
+else {
109
110
111
112
113
## Variable declarations
114
115
Declare one variable per var statement. Try to put those declarations at the beginning of each scope.
0 commit comments