i have the following loop which is iterating through an array and i try to access the next position of the current position in the array.
for( var i in myArray){
var temp = myArray[i+1];
}
The problem is that it not add the 1 with the var i but it just appends the number 1 on the i. Like i is 2 and i do this
i+1
the result is
21
and not 3.
Why is this so and how can i add the two variables?