Skip to content

Commit

Permalink
Merge pull request chuanxshi#85 from syabro/patch-1
Browse files Browse the repository at this point in the history
Update single-var-pattern.html
  • Loading branch information
chuanxshi committed Sep 6, 2013
2 parents 0c0948d + 0ac46a3 commit 97bd0b0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion general-patterns/single-var-pattern.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,23 @@
style = el.style;
// do something with el and style...
}

// Preferred way
// Move commas BEFORE vars
// You'll not forget to add one when adding variable to the end of list
function func() {
var a = 1
, b = 2
, sum = a + b
, myobject = {}
, i
, j;

// function body...
}

// References
// http://net.tutsplus.com/tutorials/javascript-ajax/the-essentials-of-writing-high-quality-javascript/
</script>
</body>
</html>
</html>

0 comments on commit 97bd0b0

Please sign in to comment.