Game Lab
Sprites
Groups
Drawing
Control
Math
Variables
Modulo operator
Category:Math
Returns the remainder of a division problem.
Examples
// MOD returns the remainder of a division problem
var x=10;
var y=3;
console.log(x%y);
Syntax
value1 % value2;
Parameters
Name | Type | Required? | Description |
---|---|---|---|
value1 | Number | The dividend of the division, the number being divided. | |
value2 | Number | The divisor of the division, the number value1 is being divided by. |
Found a bug in the documentation? Let us know at support@code.org.