You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We define variables with multiple `var` statements and trust our developers to understand [hoisting]. We generally discourage defining variables inside loops or blocks.
207
+
208
+
We do this:
209
+
210
+
```js
211
+
var foo =1;
212
+
var bar =2;
213
+
214
+
var baz;
215
+
if (foo === bar) {
216
+
baz =3;
217
+
}
218
+
```
219
+
220
+
We _don't_ do this:
221
+
222
+
```js
223
+
var foo =1,
224
+
bar =2;
225
+
226
+
if (foo === bar) {
227
+
var baz =3;
228
+
}
229
+
```
230
+
231
+
203
232
Client-Side JavaScript Architecture
204
233
-----------------------------------
205
234
@@ -272,4 +301,5 @@ An example utility might be a function to make a string title-case.
0 commit comments