var variable1 = "Hello World!";
var variable2 = "Testing...";
var variable3 = 42;
var variable1 = "Hello World!",
variable2 = "Testing...",
variable3 = 42;
The first way is easier to maintain. Each declaration is a single statement on a single line, so you can easily add, remove, and reorder the declarations.
With the second way, it is annoying to remove the first or last declaration because they contain the
var keyword and semicolon. And every time you add a new declaration, you have to change the semicolon in the old line to a comma.