HomeSoftware DevelopmentJavascript The rest Project Operator - GeeksforGeeks

Javascript The rest Project Operator – GeeksforGeeks

Enhance Article

Save Article

Like Article

Enhance Article

Save Article

The The rest Project Operator in javascript is represented by “%=”.  This operator is used to divide the worth of the variable by one other operand and assign the rest to the variable which is the primary operand. This may be additionally defined as assigning the rest to the primary operand which is obtained by dividing the variable from the second operand.


x %= y 
x = x % y

Instance 1: On this instance, we’ll use the rest operator.


let a = 17;

console.log(a %= 2);

console.log(a %= 0);

console.log(a %= 'bar');


Instance 2: On this instance, we’ll going to see using the rest operator.


let a = 28;

a %= 7;



let b = NaN;

b %= 2;


We now have an entire checklist of Javascript Project Operators, Please verify this text Javascript Project Operator.

Supported Browser:

  • Chrome 1
  • Edge 12
  • Firefox 1
  • Opera 3
  • Safari  1

Most Popular

Recent Comments