How to Get Division Remainder in Javascript
Posted on: March 06, 2021 by Ariessa Norramli
In this article, you will learn how to get a division remainder in Javascript.
Let’s say you have 2 numbers.
var a = 100;
var b = 26;
Get Division Remainder
In order to get a division remainder, you can use the modulo operator, %
.
var a = 100;
var b = 26;
console.log(a + " % " + b + " = " + a % b);
// => "100 % 26 = 22"
Note: The modulo operator, %
functions by returning the remainder in an arithmetic division.
Share on social media
//