Skip to content

Commit 72adc9f

Browse files
committed
(Coding Convention) Fix indents to use 4 spaces (per the same guideline).
1 parent 10becba commit 72adc9f

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

CodingConvention.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Your opening braces go on the same line as the statement.
7272

7373
~~~ {.javascript}
7474
if (true) {
75-
console.log('winning');
75+
console.log('winning');
7676
}
7777
~~~
7878

@@ -81,7 +81,7 @@ if (true) {
8181
~~~ {.javascript}
8282
if (true)
8383
{
84-
console.log('losing');
84+
console.log('losing');
8585
}
8686
~~~
8787

@@ -267,7 +267,7 @@ Use the [strict comaprison operators][comparisonoperators]. The triple equality
267267
~~~ {.javascript}
268268
var a = 0;
269269
if (a === '') {
270-
console.log('winning');
270+
console.log('winning');
271271
}
272272
273273
~~~
@@ -277,7 +277,7 @@ if (a === '') {
277277
~~~ {.javascript}
278278
var a = 0;
279279
if (a == '') {
280-
console.log('losing');
280+
console.log('losing');
281281
}
282282
~~~
283283

@@ -309,7 +309,7 @@ Always use curly braces even in the cases of one line conditional operations.
309309

310310
~~~ {.javascript}
311311
if (a) {
312-
return 'winning';
312+
return 'winning';
313313
}
314314
315315
~~~
@@ -318,8 +318,8 @@ if (a) {
318318

319319
~~~ {.javascript}
320320
321-
if (a)
322-
return 'winning';
321+
if (a)
322+
return 'winning';
323323
324324
if (a) return 'winning';
325325
~~~
@@ -332,11 +332,11 @@ if (a) return 'winning';
332332
~~~ {.javascript}
333333
334334
if(condition) {
335-
console.log('winning');
335+
console.log('winning');
336336
}
337337
338338
if (!condition) {
339-
console.log('winning');
339+
console.log('winning');
340340
}
341341
342342
~~~
@@ -346,15 +346,15 @@ if (!condition) {
346346
~~~ {.javascript}
347347
348348
if(condition === true) {
349-
console.log('losing');
349+
console.log('losing');
350350
}
351351
352352
if(condition !== true) {
353-
console.log('losing');
353+
console.log('losing');
354354
}
355355
356356
if(condition !== false) {
357-
console.log('losing');
357+
console.log('losing');
358358
}
359359
360360
~~~
@@ -372,7 +372,7 @@ Do not use the **Yoda Conditions** when writing boolean expressions:
372372
~~~ {.javascript}
373373
var num;
374374
if(num >= 0) {
375-
console.log('winning');
375+
console.log('winning');
376376
}
377377
~~~
378378

@@ -381,14 +381,14 @@ if(num >= 0) {
381381
~~~ {.javascript}
382382
var num;
383383
if(0 <= num) {
384-
console.log('losing');
384+
console.log('losing');
385385
}
386386
~~~
387387

388388
**NOTE** It is OK to use constants on the left when comparing for a range.
389389
~~~ {.javascript}
390390
if(0 <= num && num <= 100) {
391-
console.log('winning');
391+
console.log('winning');
392392
}
393393
~~~
394394

@@ -408,22 +408,22 @@ as possible. In certain routines, once you know the answer, you want to return i
408408

409409
~~~ {.javascript}
410410
function getSomething(val) {
411-
if (val < 0) {
412-
return false;
413-
}
414-
415-
if (val > 100) {
416-
return false;
417-
}
418-
419-
var res1 = doOne();
420-
var res2 = doTwo();
421-
var options = {
422-
a: 1,
423-
b: 2
424-
};
425-
var result = doThree(res1, res2, options);
426-
return result;
411+
if (val < 0) {
412+
return false;
413+
}
414+
415+
if (val > 100) {
416+
return false;
417+
}
418+
419+
var res1 = doOne();
420+
var res2 = doTwo();
421+
var options = {
422+
a: 1,
423+
b: 2
424+
};
425+
var result = doThree(res1, res2, options);
426+
return result;
427427
}
428428
~~~
429429

0 commit comments

Comments
 (0)