When I read javascript code that is clean and written by people who are obviously very good at it, I often see this pattern
var x = some.initialization.method(),
y = something.els(),
z;
What is the advantage of that over writing
var x = some.initialization.method();
var y = something.els();
var z;
The second format is easier to maintain, since each line exists by itself. So you can erase a line or add a line, and not have to look around to see if it's the first or last variable to be initialized. This also means source control diffs/merges will work better. Given these disadvantages, I'm guessing there's some advantage to the first format -- but what is it? Surely they execute identically because it's the same to the parser.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…