0

I'm relatively new to Javascript programming. When reading some code that others have written, I noticed that multiple var declaration is grouped together like this:

var foo = bla,
    bar = bla,
    foo1,
    bar1;

Actually Douglas Crockford also suggest this style on his website. But it looks quite unpleasant to my eye. I would much prefer

var foo = bla;
var bar = bla;
var foo1;
var bar1;

Besides less typing, is there any reason one would prefer the first style?

lang2
  • 11,433
  • 18
  • 83
  • 133

0 Answers0