Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
小なりイコール演算子 (<=) は、左オペランドが右オペランド以下の場合は true を返し、それ以外の場合は false を返します。
オペランドは、小なり演算子と同じアルゴリズムを使用して、オペランドを入れ替えて比較され、結果が反転されます。 x <= y は通常 !(y < x) と同等ですが、 x <= y と x > y の両方が false となる 2 つの例外があります。
さらに、x <= y は x を y より前にプリミティブ型に型変換し、y < x は y を x より前にプリミティブ型に型変換します。型変換には副作用を 持つ可能性が あるため、オペランドの順序が重要になる場合があります。
x <= y は、一般的に x > y || x == y と同等ですが、次のいくつかの例外があります。
| ECMAScript® 2027 Language Specification # sec-relational-operators |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年9月9日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.