I have variable x, x1, y, y1. I want to change value of variable like below:
First time loop run: x= 0, x1=1, y=0, y=1
Second time loop run: x= 0, x1 = 1, y=2, y=3
Third time loop run: x= 2, x1 = 3, y=0, y=1
fourth time loop run: x= 2, x1 = 3, y=2, y=3
Can anyone help please.
var x,x1,y,y1
for(var i=0; i<4; i++){
x = i;
x1 = i+1;
y = i;
y1= i+1;
console.log(x,x1,y,y1);
}