+ 1
can anytone tell me why the answer is 1??thanks in advance :)
var a =3; var b = 2; var z =(++b+a--)%5; document.write(z);
2 Answers
+ 4
++b increments the value of b before evaluating it.
a-- evaluates the value of a before decrementing it.
% gives the remainder of the euclidian division.
So z is equals to (3+3)%5, ie 1.
0
thank you