Thursday, November 13, 2025
HomeLanguagesJavascriptLess Than or Equal(<=) Comparison Operator in JavaScript

Less Than or Equal(<=) Comparison Operator in JavaScript

JavaScript Less Than or Equal(<=) to the operator is used to compare two operands and return true if the left operand is smaller or equal to the right operand. The algorithm used for the comparison is the same as that of less than operator but equal condition is also checked

Syntax:

a<=b

Example 1: In this example, we will compare String, Number, and Boolean using Less Than or Equal Operator.

Javascript




console.log("3"<=2);
console.log("2"<=3);
console.log(true<=false);
console.log("3"<="2");
console.log(3<=2);


Output: The values are converted to the same data type and then compared. Here true is treated as one and false as 0. Therefore false is less than true. 

false
true
false
false
false

Example 2: In this example, we will use the greater than or equal operator on BigInt and other data types.

Javascript




console.log(2n<=2);
console.log(5n<=4);
console.log(undefined<=null);
console.log(null<=undefined)


Output: 2n is equal to 2 as the comparison is made after type conversion

true
false
false
false

Supported Browsers:

  • Chrome
  • Edge
  • Firefox
  • Opera
  • Safari

We have a complete list of JavaScript Comparison Operators, to check those please go through, the JavaScript Comparison Operator article

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32399 POSTS0 COMMENTS
Milvus
95 POSTS0 COMMENTS
Nango Kala
6765 POSTS0 COMMENTS
Nicole Veronica
11916 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11983 POSTS0 COMMENTS
Shaida Kate Naidoo
6889 POSTS0 COMMENTS
Ted Musemwa
7141 POSTS0 COMMENTS
Thapelo Manthata
6834 POSTS0 COMMENTS
Umr Jansen
6838 POSTS0 COMMENTS