+ 1

Why code's answer is 13?

var I= 12; (++I) % 3; alert(I);

24th Jun 2019, 2:48 PM
Irezer
Irezer - avatar
3 Antworten
+ 3
Pikachu ~ swim ~ i see i see. Thanks for explanation. :D *hugs*
24th Jun 2019, 2:57 PM
Irezer
Irezer - avatar
+ 2
++l makes the variable increase by one, and when you %3, it actually has no effect because you are not defining anything with it. Because 12 is the original variable and it increases by one, the answer will be 13.
24th Jun 2019, 2:51 PM
Pikachu
Pikachu - avatar