Say I am writing a code like so:
Var[0] = 0
Var[1] = 1
Var[2] = 2
And I want to output the variables with a while loop so that they are output in a document.write(Var+'<br>') but that they stop outputting depending on the number in the Var[] brackets IF the number is NOT static -- that is the user can choose to add to Var[] (Var[3], Var[4]) but doesn't need to update the while loop (while (i<...). Is there any way for the script to determine the numbers inside the brackets by itself and then break once that number has been reached? Thanks.
Var[0] = 0
Var[1] = 1
Var[2] = 2
And I want to output the variables with a while loop so that they are output in a document.write(Var+'<br>') but that they stop outputting depending on the number in the Var[] brackets IF the number is NOT static -- that is the user can choose to add to Var[] (Var[3], Var[4]) but doesn't need to update the while loop (while (i<...). Is there any way for the script to determine the numbers inside the brackets by itself and then break once that number has been reached? Thanks.