//Hello
//I want to define an array in a line of the program, for example, as follows
var a = [2,5];
//In the next steps, I want to increase the array elements as follows:
a[0] += 2;
a[1] += 2;
//And I want the array to increase intermittently at the output of the program, as follows:
a = [4,7]
a = [6,9]
a = [8,11]
....
// But in reality this does not happen because in the first line of the program, the array is //defined again and again //And the output is always as follows: a = [4,7] // Is there a way to initialize the a array as [2,5] only once????
Via Active questions tagged javascript - Stack Overflow https://ift.tt/CL3pYB8
Comments
Post a Comment