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
๐ŸŒ
Josh W. Comeau
joshwcomeau.com โ€บ javascript โ€บ modulo-operator
Understanding the JavaScript Modulo Operator โ€ข Josh W. Comeau
No matter how large our underlying timeElapsed value grows, we can have it cycle indefinitely through the colors in the COLORS array. In my opinion, this trick alone makes the modulo operator worth learning!
๐ŸŒ
Reddit
reddit.com โ€บ r/programming โ€บ understanding the javascript modulo operator
r/programming on Reddit: Understanding the JavaScript Modulo Operator
December 12, 2023 - The post explains the Modulo operator (%) in JavaScript, which is often misunderstood and appears to produce random values. The author clarifies its function by redefining how we think about division, emphasizing that it's about dividing a number into equally-sized groups without fractional remainders. The remainder is what the modulo operator calculates. A practical use case provided is in creating circular arrays, like cycling through a list of colors indefinitely with time.
๐ŸŒ
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 - We can use the modulo operator to create cyclic patterns, such as cycling through an array, iterating through a sequence of states, or implementing infinite loops.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Operators โ€บ Remainder
Remainder (%) - JavaScript | MDN
In JavaScript, the modulo operation (which doesn't have a dedicated operator) is used to normalize the second operand of bitwise shift operators (<<, >>, etc.), making the offset always a positive value.
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ javascript โ€บ modulo-operator
JavaScript Modulo Operator: Syntax, Usage, and Examples
JavaScript follows the rule that the sign of the result matches the sign of the dividend (left operand). ... In all of these cases, the result retains the sign of the left-hand operand. This detail matters when using modulo inside loops or iteration processes, where you rely on predictable patterns. This behavior is crucial when you're performing logic that depends on the result being positiveโ€”for example, wrapping array indices or creating cyclic counters.
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_arithmetic.asp
JavaScript Arithmetic
The modulus operator (%) returns the division remainder. let x = 5; let y = 2; let z = x % y; Try it Yourself ยป ยท In arithmetic, the division of two integers produces a quotient and a remainder. In mathematics, the result of a modulo operation is the remainder of an arithmetic division.
๐ŸŒ
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 ... for JavaScript, you will use 10 % 3. It divides the first operand (the dividend) by the second operand (the divisor) and returns the remainder....
Find elsewhere
๐ŸŒ
AlgoCademy
algocademy.com โ€บ link
Modulo Operator in JavaScript | AlgoCademy
Even or Odd: You can use the modulo operator to check if a number is even or odd. If number % 2 equals 0, the number is even; otherwise, it is odd. Cycling Through Indices: When working with arrays, the modulo operator can help cycle through indices, ensuring they stay within bounds.
๐ŸŒ
Codedamn
codedamn.com โ€บ news โ€บ javascript
JavaScript Modulo Operator Guide With Examples
June 3, 2023 - In this example, we're using the modulo operator to get the remainder of i divided by the array length.
๐ŸŒ
John Kavanagh
johnkavanagh.co.uk โ€บ home โ€บ articles โ€บ using the modulo operator in javascript
Using the Modulo Operator in JavaScript, by John Kavanagh
February 27, 2024 - Here, I'm using modulo to calculate the following index in an array, rolling back to 0 if we've reached the end of the array. The modulo operator in JavaScript is a simple yet powerful tool that extends beyond basic arithmetic.
๐ŸŒ
Banjocode
banjocode.com โ€บ post โ€บ javascript โ€บ iterate-array-with-modulo
Iterate Over An Array With The Modulo Operator | banjocode
The modulo operator is often used to calculate if a value is odd or even, however, it comes to great use when you want to iterate (and re-iterate) an array without having to deal with to much logic.
๐ŸŒ
Mastering JS
masteringjs.io โ€บ tutorials โ€บ fundamentals โ€บ modulus
The Modulus Operator in JavaScript - Mastering JS
The modulus operator in JavaScript returns the remainder when the first operand is divided by the second operand. Here's what you need to know.
๐ŸŒ
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.
๐ŸŒ
Reddit
reddit.com โ€บ r/webdev โ€บ understanding the javascript modulo operator
r/webdev on Reddit: Understanding the JavaScript Modulo Operator
August 31, 2023 - The post explains the Modulo operator (%) in JavaScript, which is often misunderstood and appears to produce random values. The author clarifies its function by redefining how we think about division, emphasizing that it's about dividing a number into equally-sized groups without fractional remainders. The remainder is what the modulo operator calculates. A practical use case provided is in creating circular arrays, like cycling through a list of colors indefinitely with time.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ javascript-remainder-operator
JavaScript Remainder(%) Operator - GeeksforGeeks
July 23, 2025 - Example 1: This example returns the positive remainder in this case both modulo and remainder will be the same as both operands are positive. ... <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("Remainder is "+rem) console.log("Modulo is "+mod) </script>