Skip to content

Commit aa13d30

Browse files
authored
Merge pull request chuanxshi#99 from eddiemoore/master
Fixed some indentation issues
2 parents a2d5cc3 + 593fa75 commit aa13d30

2 files changed

Lines changed: 39 additions & 39 deletions

File tree

general-patterns/parseint.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
var month = "06",
19-
year = "09";
19+
year = "09";
2020
month = parseInt(month, 10);
2121
year = parseInt(year, 10);
2222

general-patterns/single-var-pattern.html

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,50 @@
66
</head>
77
<body>
88
<script>
9-
/* Title: Single var Pattern
10-
Description: use one var statement and declare multiple variables
11-
*/
9+
/* Title: Single var Pattern
10+
Description: use one var statement and declare multiple variables
11+
*/
1212

13-
/* Benefits:
14-
* 1. Provides a single place to look for all the local variables needed by the function
15-
* 2. Prevents logical errors when a variable is used before it's defined
16-
* 3. Helps you remember to declare variables and therefore minimize globals
17-
* 4. Is less code (to type and to transfer over the wire)
18-
*/
13+
/* Benefits:
14+
* 1. Provides a single place to look for all the local variables needed by the function
15+
* 2. Prevents logical errors when a variable is used before it's defined
16+
* 3. Helps you remember to declare variables and therefore minimize globals
17+
* 4. Is less code (to type and to transfer over the wire)
18+
*/
1919

20-
function func() {
21-
var a = 1
22-
, b = 2
23-
, sum = a + b
24-
, myobject = {}
25-
, i
26-
, j;
20+
function func() {
21+
var a = 1
22+
, b = 2
23+
, sum = a + b
24+
, myobject = {}
25+
, i
26+
, j;
2727

28-
// function body...
29-
}
28+
// function body...
29+
}
3030

31-
function updateElement() {
32-
var el = document.getElementById("result")
33-
, style = el.style;
34-
// do something with el and style...
35-
}
36-
37-
// Preferred way
38-
// Move commas BEFORE vars
39-
// You'll not forget to add one when adding variable to the end of list
40-
function func() {
41-
var a = 1
42-
, b = 2
43-
, sum = a + b
44-
, myobject = {}
45-
, i
46-
, j;
31+
function updateElement() {
32+
var el = document.getElementById("result")
33+
, style = el.style;
34+
// do something with el and style...
35+
}
4736

48-
// function body...
49-
}
37+
// Preferred way
38+
// Move commas BEFORE vars
39+
// You'll not forget to add one when adding variable to the end of list
40+
function func() {
41+
var a = 1
42+
, b = 2
43+
, sum = a + b
44+
, myobject = {}
45+
, i
46+
, j;
5047

51-
// References
52-
// http://net.tutsplus.com/tutorials/javascript-ajax/the-essentials-of-writing-high-quality-javascript/
48+
// function body...
49+
}
50+
51+
// References
52+
// http://net.tutsplus.com/tutorials/javascript-ajax/the-essentials-of-writing-high-quality-javascript/
5353
</script>
5454
</body>
5555
</html>

0 commit comments

Comments
 (0)