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 Overflow
🌐
MDN 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....
🌐
freeCodeCamp
freecodecamp.org › news › javascript-modulo-operator-how-to-use-the-modulus-in-js
JavaScript Modulo Operator – How to Use the Modulus in JS
November 7, 2024 - For example, 10 modulo 3 will be 1 (I'll explain how this works after the code sample below). The short form is 10 mod 3 = 1. But for JavaScript, you will use 10 % 3. It divides the first operand (the dividend) by the second operand (the divisor) ...
🌐
Josh W. Comeau
joshwcomeau.com › javascript › modulo-operator
Understanding the JavaScript Modulo Operator • Josh W. Comeau
In the example widget above, our dividend (the number to be divided) is 12. 12 is a remarkably clean number when it comes to division; it can be split neatly in lots of different ways.
🌐
Codedamn
codedamn.com › news › javascript
JavaScript Modulo Operator Guide With Examples
June 3, 2023 - In this example, we're using the modulo operator to find the remainder of the division 10 ÷ 3. The result is 1, as when you divide 10 by 3, you get a quotient of 3 and a remainder of 1. The modulo operator can be helpful in determining whether ...
🌐
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.
🌐
LogRocket
blog.logrocket.com › home › mastering the modulo operator in javascript: a complete guide
Mastering the modulo operator in JavaScript: A complete guide - LogRocket Blog
June 4, 2024 - In those cases, the number that is left over after the division operation is complete is referred to as the remainder. For example, when we divide 10 by three, we get a quotient of three and a remainder of one. We can also write this as 1 (mod ...
🌐
Career Karma
careerkarma.com › blog › javascript › javascript modulo: a how-to guide
JavaScript Modulo: A How-To Guide | Career Karma
December 1, 2023 - The JavaScript Math.round() method rounds the value returned by our division sum to the nearest decimal place. This is useful because we cannot buy part of a candy bar. Next, we can use the modulo operator to check if the number of candy bars we can buy is odd or even:
Find elsewhere
🌐
Rip Tutorial
riptutorial.com › remainder / modulus (%)
JavaScript Tutorial => Remainder / Modulus (%)
When the first operand is a negative ... values. In the example above, 10 can be subtracted four times from 42 before there is not enough left to subtract again without it changing sign....
🌐
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:
🌐
Codingem
codingem.com › home › javascript % operator: an ultimate guide to modulos
JavaScript % Operator: An Ultimate Guide to Modulos - codingem.com
July 10, 2025 - In JavaScript, the modulo operator has the same precedence level as: ... Floor division (//). For example, if you multiply first and then take a modulo, the multiplication takes place first.
🌐
30 Seconds of Code
30secondsofcode.org › home › javascript › math › quotient and remainder of division
Calculate the quotient and remainder of a division in JavaScript - 30 seconds of code
December 28, 2023 - For example, divmod(8, 3) returns (2, 2) because 8 / 3 = 2 with a remainder of 2. In order to implement divmod() in JavaScript, we can use the built-in Math.floor() function to get the quotient and the modulo operator (%) to get the remainder ...
🌐
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 ...