Blank Line Usage in JavaScript

Question
How should blank lines be used when developing in JavaScript?

Answer
In general, use blank lines to separate related lines of code from unrelated lines of code. Here are some specifics:
• Add blank lines between methods.
• Add blank lines between local variables in a method and its first statement.
• Add blank lines before multi-line or single-line comments.
• Add blank lines between logical sections inside methods.

Comments
On the whole, your code should look like a series of paragraphs.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s