+ 1
How the output is 7?
var x = 7; var y = x++; var z = y++ % x; alert(z); 7 will be alerted. but i don't understand how the z will be 7?
2 Respostas
+ 10
x=7
y=7; x=8
z=7%8=7; y=8
alert(z) = 7
0
learn about prefix, postfix in increment and decrement. it will helps a lots about this concept.