+ 2
Please can anyone explain to me why the modulus of 2 is 2?
var str =""; str += 2 % 3; Console.log(str); Result= 2
3 Answers
+ 2
2 == 3*0 + 2 // remainder is 2
+ 2
2%3=3*0+2!
+ 1
Because if you divide 2 by 3, the remainder will be 2.
var str =""; str += 2 % 3; Console.log(str); Result= 2