jquery - Simplify Multiple Variables in JavaScript -


this question has answer here:

how simplify set of vars?

        var q1 = 0;         var q2 = 0;         var q3 = 0;         var q4 = 0;         var q5 = 0;         var q6 = 0;         var q7 = 0;         var q8 = 0;         var q9 = 0;         var q10 = 0;         var counter = 0; 

or this?

var q1 = 0, q2 = 0, q3 = 0, q4 = 0, q5 = 0, q6 = 0, q7 = 0, q8 = 0, q9 = 0, q10 = 0, counter = 0; 

is there way around?

if use series variables. best option array

 var q=[0,0,0,0,0,0,0,0,0,0] , counter=0; 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -