For clairifying you can add a string to a variable then add other variables as such;
var one = "test", super,apple,pear,cardboard
The string "test" will be assigned to the variable one as well; super, apple, pear, cardboard will also be created variables ?

Recommended Answers

The variables will be created, but will be undefined. See Chrome watched variables on breakpoint:

breakpoint.PNG

Jump to Post

All 3 Replies

Member Avatar

The variables will be created, but will be undefined. See Chrome watched variables on breakpoint:

breakpoint.PNG

Member Avatar

Personally, I declare variables individually each on their own line - clarity over brevity. You can always minimize and gzip the production version anyhow.

diafol - When you say undefined you mean you must define them later, gotcha :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.