+ 5
Please explain this JS challenge...
What is the output of this code? var x = 8; var y = x++ * 5; var z = y % x; alert(z);
2 Respostas
+ 4
Thanks! Output 4 is correct. So x++ only increments after x*5 is assigned to y. Is there a rule?
+ 1
Yes. Examples:
var x = 5;
alert(x++);
alert(x);
// the output is 5 and 6
var x = 5;
alert(++x);
alert(x);
// the output is 6 and 6



