Math operator part 4

The Modulus



Modulus (%) operator returns the division remainder (what is left over).
var myVariable = 26 % 6;

//myVariable equals 2
Try It Yourself

In JavaScript, the modulus operator is used not only on integers, but also on floating point numbers.
What is the result of using modulus operator for 38%5?

 
 3 ans

Comments

Popular posts from this blog

Introducing object part 3

Comparison Operators part 2

Module 2