Skip to content

Comma-first vars should be encouraged. #195

Open
@programmin1

Description

@programmin1

It says "Any project that cites this document as its base style guide will not accept comma first code formatting", yet I have found comma-first is the best way if you don't want multiple var statements

For example:

var a=1,
      b=3
      c=4

will easily make a global variable c, which is likely not intended.

This style:

var a=1
,   b=3
,   c=4

is more obvious when a comma is missing - causing a global variable to be created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions