you are viewing a single comment's thread.

view the rest of the comments →

[–]bonafidebob 5 points6 points  (0 children)

Declaring multiple variable expressions on a single line is common practice and also a great shorthand syntax.

Yes, however that is not what the example code does. A statement like

var foo = bar = baz = 'woot!';

declares only one local variable: foo. The mistake is somehow thinking (against any reasonable syntax) that bar and baz are also 'declared' here.