Favorites

JavaScript <= Less than or equal Operator

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
<=
JavaScript Comparison OperatorThis operator is supported by all modern browsers.
Updated 28th November 2026

The less than or equal operator (<=) checks whether the left value is smaller than or equal to the right one.

Description

The less than or equal operator <= returns true if the left operand is smaller than or equal to the right. A common use is in loop conditions.

Like the other relational operators, it converts strings and objects before comparing, and null is treated as 0, which explains the odd-looking result that null <= 0 is true while null == 0 is false. Any comparison with NaN returns false.

In loops, choosing between < and <= decides whether the end value is included. Off-by-one errors often come from using <= with an array length; for arrays, loop with i < arr.length because the last index is one less than the length.

Properties

Operator
<=
Category
Comparison
Precedence
9 (1 is lowest, 18 is highest)
Associativity
left-to-right

Syntax

x <= y

Example

for (let i = 1; i <= 3; i++) console.log(i);
console.log(null <= 0, null == 0);

Browser Support

The following information will show you the current browser support for the <= operator. Hover over a browser icon to see the version that first introduced support for this operator.

This operator is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee