Question:What is the correct output for the following code?
var x=10;
x*=4;
x++;
x-=3;
alert(x);
A 40
B 41
C 37
D 38
/38
+ Answer
D
+ Explanationvar x=10;
Evaluate line x*=4 as x=x*4 >x=10*4 > x=40
Evaluate line x++ as x=x+1 > x=40+1 > x=41
Evaluate line x-=3 as x=x-3 > x=41-3 > x=38
Therefore, the final value of x will be 38