<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="utf-8">
    <title>Operator Assigemnt JavaScript</title>
</head>
<body>
    <script>
    var x;    // Deklarasi Variabel
 
    x = 10;
    document.write(x + "<br>"); // Cetak: 10
    
    x = 20;
    x += 30;
    document.write(x + "<br>"); // Cetak: 50
     
    x = 50;
    x -= 20;
    document.write(x + "<br>"); // Cetak: 30
     
    x = 5;
    x *= 25;
    document.write(x + "<br>"); // Cetak: 125
     
    x = 50;
    x /= 10;
    document.write(x + "<br>"); // Cetak: 5
     
    x = 100;
    x %= 15;
    document.write(x); // Cetak: 10
    </script>
</body>
</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.