Skip to content

Commit 6a5e41e

Browse files
author
Marti Martz
committed
Merge pull request #205 from Martii/Issue-19StyleGuide
Clarification of commas a bit more.
2 parents fb24402 + 5086c25 commit 6a5e41e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

STYLEGUIDE.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Blank spaces should be used in the following circumstances:
116116
* All binary operators except period, left-parenthesis, and left-bracket should be separated from their operands by a space.
117117
* No space should separate a unary operator and its operand except when the operator is a word such as `typeof`
118118
* Each semi-colon in the control part of a `for` statement should be followed with a space.
119-
* Whitespace should follow every comma.
119+
* Whitespace should follow every comma except when adding a newline
120120

121121
---
122122

@@ -324,8 +324,11 @@ Avoid forms that are indistinguishable from common errors.
324324

325325
### Comma Operator
326326

327-
Avoid the use of the comma operator, except for very disciplined use, in the control part of `for` statements
328-
*(this does not apply to the comma separator, which is used in object literals, array literals, var statements, and parameter lists).*
327+
Avoid the use of the comma operator, except for very disciplined use, in the control part of `for` statements.
328+
329+
### Comma Separator
330+
331+
Object literals, array literals, and parameter lists should not have a trailing comma on the last item.
329332

330333
---
331334

0 commit comments

Comments
 (0)