Home

Comparison operators

Open the developer console to see the result

Comparison operators:
----------------------------
x1 == x2    => true
x1 === x2   => false
x1 !== y    => true
x1 < y      => false
x1 > y      => true

const x1 = 10;
const x2 = '10';
const y = 5;

const example = `Comparison operators:
----------------------------
x1 == x2    => ${x1 == x2}
x1 === x2   => ${x1 === x2}
x1 !== y    => ${x1 !== y}
x1 < y      => ${x1 < y}
x1 > y      => ${x1 > y}`;

console.log(example);
document.querySelector('pre').innerHTML = example;