Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 4 variables in jquery called qual1p, qual2p, qual3p and qual4p.

I want to assign values to them inside a for loop.

something like
C#
for (var i = 0; i < blue.length; i++) {
        qual?p = blue[i][5];
}



how do I code qual?p so that ? is i ?

Thanks
Posted
Updated 4-Nov-15 7:32am
v2

1 solution

There are several suggestions here, http://stackoverflow.com/questions/3834373/how-to-reference-a-variable-dynamically-in-javascript[^].

I believe the object one is the one you'll likely want to use.
 
Share this answer
 
Comments
Nosfa 6-Nov-15 17:18pm    
I have to make an array. There's no other way. thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900