What would be the output of the following snippet? (Based on Arithmetic operators)
@Yomesh Gupta
let x = 1;
do {
let y = --x;
console.log(x++ + --y);
} while (x++ < 5);
Option 1
-1 1 3 5 7
Option 2
0 2 4 6
Option 3
0 2 4 6 8
Option 4
-1 1 3 5
let x = 1;
do {
let y = --x;
console.log(x++ + --y);
} while (x++ < 5);
-1 1 3 5 7
0 2 4 6
0 2 4 6 8
-1 1 3 5