D
Deleted member 2829
Guest
I seem to have hit a blind spot, being quite stumped by this line I found in a W3C example:
Intuitively I understand that this is testing whether count (an integer counter) is a multiple of n (a variable with value 150), and I believe it is working that way in the example.
Yet, I can't get my head around it.
I hope someone here can talk some sense into me 🙄
JavaScript:
if ( (count / n) % 1 == 0 )
Intuitively I understand that this is testing whether count (an integer counter) is a multiple of n (a variable with value 150), and I believe it is working that way in the example.
Yet, I can't get my head around it.
x % 1
is defined as the remainder after dividing x
by 1
. To my befuddled mind, this is exactly the same as x
itself.I hope someone here can talk some sense into me 🙄