<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript Assignment Operators</title>
</head>
<body>
<pre> <!-- Use pre element for work document.writeln() method -->
<script type="text/javascript">
var x = 17, y = 5;
var result = x; // Assignment to left operand(result) base on right operand(y).
document.writeln("Assignment : ", result);
document.writeln("Addition : ", result += y);
document.writeln("Subtraction : ", result -= y);
document.writeln("Multiplication : ", result *= y);
document.writeln("Division : ", result /= y);
document.writeln("Modulus : ", result %= y, "<br />");
document.writeln("Bitwise AND : ", result &= y);
result = 2; // Reassign value
document.writeln("Bitwise OR : ", result |= y);
document.writeln("Bitwise XOR : ", result ^= y, "<br />");
document.writeln("Shift Left : ", result <<= y);
document.writeln("Shift Right : ", result >>= y);
</script>
</pre>
</body>
</html>