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 ?

Member Avatar for diafol

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

breakpoint.PNG

Member Avatar for diafol

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.