Assignment operators are used to assign values to variables. They can also perform an operation and assignment in one step.
let x = 10;
console.log(x); // 10
let a = 10;
a += 5; // a = a + 5 โ 15
a -= 3; // a = a - 3 โ 12
a *= 2; // a = a * 2 โ 24
a /= 4; // a = a / 4 โ 6
a %= 4; // a = a % 4 โ 2
Click the button to apply assignment operators step by step: