A definition of what it is and what it does would be much appreciated.
The modulus operator is used as follows:
var1 % var2
The modulus operator returns the first operand modulo the second operand, that is, var1 modulo var2, in the preceding statement, where var1 and var2 are variables. The modulo function is the integer remainder of dividing var1 by var2. For example, 12 % 5 returns 2. The result will have the same sign as var1; that is, −1 % 2 returns −1.
As explained in other answers, it returns the remainder after dividing the dividend by divisor, however this is no longer modulo operator, this is remainder operator. the difference being that the modulo operator result would take the sign of the divisor, not the dividend.Quoted from MDN
The remainder operator returns the remainder left over when one operand is divided by a second operand. It always takes the sign of the dividend, not the divisor. It uses a built-in modulo function to produce the result, which is the integer remainder of dividing
var2— for example —
var1 modulo var2. There is a proposal to get an actual modulo operator in a future version of ECMAScript, the difference being that the modulo operator result would take the sign of the divisor, not the dividend.
-10 % 3 // -1 10 % -3 // 1
It returns the remainder of a division operation.
That would be the modulo operator.
It returns the remainder of a division operation:
var remainder = 3 % 2; // equals 1
It is a modulo operator. It calculates the remainder.
If we do 23 % 10, first, we divide 23 by 10 which equals 2.3 then take .3 * (the divisor) 10 = 3