I'm learning node.js and am trying out Express. My first app had this code:
var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, http = require('http')
, path = require('path');
Reading through the mongoose tutorial gives me this:
var mongoose = require('mongoose')
, db = mongoose.createConnection('localhost', 'test');
On strict mode, JSHint gives me
app.js: line 6, col 32, Bad line breaking before ','.
Which shows that I'm not the only one out there who's bugged by this syntax.
Is there any reason to declare var
s this way instead of adding the comma at the end of the line?