I am trying to combine 2 variables in a loop, as the code below show i need to add a number to every var, but i cant get it to work. This is just a part of a script. As you can see the var item should become item1, item2, item3 and so on.
// the code
for (i=0; i<10; i++){
var item+' '+i = $('ul').find('.list-item-'+i).text();
}
I would use an arry:
It’s also important to see that
is an illegal declaration of a variable.