Skip to content

Commit

Permalink
Update single-var-pattern.html
Browse files Browse the repository at this point in the history
  • Loading branch information
syabro committed May 6, 2013
1 parent adb7570 commit 0ac46a3
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 0ac46a3

Please sign in to comment.