<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="utf-8">
    <title>Operator Perbandingan JavaScript</title>
</head>
<body>
    <script>
    var x = 25;
    var y = 35;
    var z = "25";
     
    document.write(x == z);  // Cetak: true
    document.write("<br>");
    
    document.write(x === z); // Cetak: false
    document.write("<br>");
    
    document.write(x != y);  // Cetak: true
    document.write("<br>");
    
    document.write(x !== z); // Cetak: true
    document.write("<br>");
    
    document.write(x < y);   // Cetak: true
    document.write("<br>");
    
    document.write(x > y);   // Cetak: false
    document.write("<br>");
    
    document.write(x <= y);  // Cetak: true
    document.write("<br>");
    
    document.write(x >= y);  // Cetak: false
    </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.