Open In App

What are Comparison Operators in JavaScript ?

Last Updated : 12 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

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); // Output: false


Output

false

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads