rwldrn/idiomatic.js — Issue #23: var statements
Author: leobalter
Created: 2012-03-01 02:50:05+00:00
State: open

This is actually not a real issue or bug report, but 2 personal opinions.

1) `var` statements should always be at start of the respective scope (functions). The same goes for `const` and `let` from ECMAScript 6.

2) `var` statements separated by commas is good, ok, but separated var declarations, one declaration by line should be good as well. It improves maintenance and readability. Example:

```javascript
var foo = "bar";
var num = 1;
var undef;
```

This is much easier if you want to remove a single declaration at any time, including the first or the last one.

Anton Kovalyov wrote about this somewhere I don't remember right now.