What are Comparison Operators in JavaScript ?
Last Updated :
12 Feb, 2024
Comparison operators in JavaScript are used to compare two values and return a boolean result (true
or false
).
They include operators such as ==
, ===
, !=
, !==
, >
, <
, >=
, and <=
.
Example: Here, the >
(greater than) the operator compares the values of a
and b
. Since a
is not greater than b
, the expression a > b
evaluates to false
, which is then logged to the console.
Javascript
let a = 5;
let b = 10;
console.log(a > b);
|
Share your thoughts in the comments
Please Login to comment...