remainder or modulus operator in javascript

Jak
Jak
Member
858 Points
132 Posts

Hi,

How to use remainder or modulus operator in JavaScript?

Views: 8784
Total Answered: 1
Total Marked As Answer: 0
Posted On: 15-Oct-2015 03:22

Share:   fb twitter linkedin
Answers
NiceOne Team
NiceOne...
Editor
1382 Points
14 Posts
         

Hi Jak,

Remainder or modulus operator is used to get the remainder of two number. Remainder or modulus operator represent by '%'.

Syntax:

var result=number1 % number2;

number1: any numeric expression
number2: any numeric expression

Example:

 var result=10 % 3;

result: 1 (10-(3*3)=1)

Posted On: 16-Oct-2015 23:10
 Log In to Chat