8000 change single var pattern comma place · unbug/javascript-patterns@68fd837 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 68fd837

Browse files
author
cattail
committed
change single var pattern comma place
1 parent adb7570 commit 68fd837

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

general-patterns/single-var-pattern.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@
1717
* 4. Is less code (to type and to transfer over the wire)
1818
*/
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

3131
function updateElement() {
32-
var el = document.getElementById("result"),
33-
style = el.style;
32+
var el = document.getElementById("result")
33+
, style = el.style;
3434
// do something with el and style...
3535
}
3636

3737
// References
3838
// http://net.tutsplus.com/tutorials/javascript-ajax/the-essentials-of-writing-high-quality-javascript/
3939
</script>
4040
</body>
41-
</html>
41+
</html>

0 commit comments

Comments
 (0)
0