It's the remainder operator and is used to get the remainder after integer division. Lots of languages have it. For example:
10 % 3 // = 1 ; because 3 * 3 gets you 9, and 10 - 9 is 1.
Apparently it is not the same as the modulo operator entirely.
Answer from MarioDS on Stack OverflowMDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › Remainder
Remainder (%) - JavaScript | MDN
For two values of the same sign, ... which can make them differ by one unit of d. To obtain a modulo in JavaScript, in place of n % d, use ((n % d) + d) % d....
Videos
16:29
Modulus operator in JavaScript | Operator | JavaScript - YouTube
04:45
Javascript Modulo Operator Explained | Understanding modulo rest ...
03:16
What is MODULO? | JavaScript in LESS-THAN 3 | JavaScript Beginner ...
04:45
Modulo Operation in JavaScript - Coderbyte - YouTube
05:23
The Remainder Operator in JavaScript | Modulo % - YouTube
W3Schools
w3schools.com › js › js_arithmetic.asp
JavaScript Arithmetic
When many operations have the same precedence (like addition and subtraction or multiplication and division), they are computed from left to right: ... JavaScript Operator Precedence Values.
Reddit
reddit.com › r/programming › understanding the javascript modulo operator
r/programming on Reddit: Understanding the JavaScript Modulo Operator
December 12, 2023 - A quick peek at the documentation would reveal that % in JavaScript is not modulo, it's the remainder operator (or can be found in the ECMAScript specification). This is confusing to many people, and unfortunately articles like these don't help by using the wrong terminology. The difference occurs when one of the values is negative. ... The result of this is 3 for "mod" and -1 for "rem". This can be confusing behavior, if for example, to implement an isOdd function, you might think of something like this:
Codecademy
codecademy.com › forum_questions › 53027ed09c4e9df1c70006e1
Javascript, Modulo and if/else | Codecademy
My code: //An example of an if/else statement with modulo in the condition ... if() { console.log(“The first number is even!”); } else { console.log(“The first number is odd!”); } Any help?
YouTube
youtube.com › watch
You'll Use This More Than You Think... JavaScript Modulo Operator (In 2 Mins) - YouTube
The remainder operator (%, or modulo, mod) in JavaScript lets you find the remainder of a division between 2 numbers. Perfect for doing obscure maths calcula...
Published August 1, 2024
Mastering JS
masteringjs.io › tutorials › fundamentals › modulus
The Modulus Operator in JavaScript - Mastering JS
For example, -21 % 5 === -1, because the remainder always takes the sign of the left number. However, a true modulus operator would always return a positive value, so 21 modulo 5 would equal 4. In practice, you are unlikely to use the remainder ...
GeeksforGeeks
geeksforgeeks.org › javascript › modulus-arithmetic-operator-in-javascript
Modulus(%) Arithmetic Operator in JavaScript - GeeksforGeeks
July 23, 2025 - The modulus (%) arithmetic operator in JavaScript returns the remainder after dividing one number by another. It is used for tasks like determining even or odd numbers, cycling through values within a range, and managing periodic events in programming. ... Return Type: Remainder of the operands. Example 1: We will check the remainder with Number and Infinity in this example.
Mimo
mimo.org › glossary › javascript › modulo-operator
JavaScript Modulo Operator: Syntax, Usage, and Examples
The JavaScript modulo operator returns the remainder left over when one number is divided by another. It does not perform rounding or any type of fractional calculation—just a pure remainder. ... In this case, 10 divided by 3 equals 3 with a remainder of 1, so 10 % 3 returns 1. ... Here, ...
Educative
educative.io › answers › what-is-the-modulo-operator-in-javascript
What is the modulo operator in JavaScript?
The modulo operator is represented by the % character in JavaScript. It returns the remainder of two integers that have been divided. ... As the remainder will always be less than the divisor, modulo operators can be very useful in restricting the range of outputs.
2ality
2ality.com › 2019 › 08 › remainder-vs-modulo.html
Remainder operator vs. modulo operator (with JavaScript code)
Example 4: -5 mod 3 === 1 (dividend is −5, divisor is 3) const dividend = -5; const divisor = 3; const quotient = Math.floor(dividend / divisor); assert.equal(quotient, -2); Modulo can also be viewed as an operation that maps an arbitrary number into a given range – for example:
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-remainder-operator
JavaScript Remainder(%) Operator - GeeksforGeeks
July 23, 2025 - ... <script> // Initializing variables var a =-4 var n = 2 // Calculating remainder var rem = a%n // Calculating modulo var mod = ((a%n)+n)%n // Printing result console.log(rem) console.log(mod) </script> ... <script> // Both operands are NaN ...