What does variable declaration with multiple comma separated values mean (e.g. var a = b,c,d;)

This is a syntactic shorthand, and identical to:

var a = b;
var c;
var d;

The first one (a) gets initialized with the value of b, but c and d are uninitialized.

Leave a Comment