If I have to create n variables a_1, a_2, a_3 ... a_n, where n is determined during runtime, how will I be able to do it?
Obviously, this code won't work:
var n = prompt("Enter number of variables?");
for (i=0; i<=n; i++) {
var a_i
}
As n is given by user it is not possible to pre-determine number of variables to be created.
In other words, Is it possible to create a variable with name from another variable in JS?