+ 1
How to work with % ? what's the rule in javascipt?
alert(60%6); = 0 How? document.write(10%6); = 4 How? How???
2 Antworten
+ 12
Modulus (%) operator returns the division remainder (what is left over).
60 divided by 6 gives 0 as a remainder ( 6*10 = 60, 60-60 = 0 ) and 10 divided by 6 gives 4 as a remainder ( 6*1 = 6, 10-6 = 4 ).
It's the basic Math in which we divide two numbers for getting a remainder :D
0
divide 60 by 6 and returns you the remainder