CARVIEW |
Select Language
HTTP/2 200
content-type: text/html
x-guploader-uploadid: AAwnv3KWOx99qYICrKivkyI3MUDktzs27YgAIUlimeRiX1UhmcgMm6a31ov3FMsHS_oq1PtR
cache-control: public, max-age=3600
expires: Fri, 10 Oct 2025 21:04:56 GMT
last-modified: Fri, 10 Oct 2025 01:12:16 GMT
etag: W/"0674f4cf4c4f806c96872cb135c76e78"
x-goog-generation: 1760058736250779
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 206265
x-goog-meta-goog-reserved-file-mtime: 1760057037
x-goog-hash: crc32c=XAdCyA==, md5=BnT0z0xPgGyWhyyxNcdueA==
x-goog-storage-class: STANDARD
accept-ranges: none
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
alt-svc: clear
referrer-policy: strict-origin-when-cross-origin
x-content-type-options: nosniff
strict-transport-security: max-age=63072000
content-security-policy: default-src 'self'; script-src 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; script-src-elem 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; style-src 'report-sample' 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self'; connect-src 'self' developer.allizom.org bcd.developer.allizom.org bcd.developer.mozilla.org updates.developer.allizom.org updates.developer.mozilla.org https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://incoming.telemetry.mozilla.org https://observatory-api.mdn.allizom.net https://observatory-api.mdn.mozilla.net https://api.github.com/search/issues stats.g.doubleclick.net https://api.stripe.com; font-src 'self'; frame-src 'self' interactive-examples.mdn.mozilla.net interactive-examples.mdn.allizom.net mdn.github.io live-samples.mdn.mozilla.net live-samples.mdn.allizom.net *.mdnplay.dev *.mdnyalp.dev *.play.test.mdn.allizom.net https://v2.scrimba.com https://scrimba.com jsfiddle.net www.youtube-nocookie.com codepen.io survey.alchemer.com https://js.stripe.com; img-src 'self' data: *.githubusercontent.com *.googleusercontent.com *.gravatar.com mozillausercontent.com firefoxusercontent.com profile.stage.mozaws.net profile.accounts.firefox.com developer.mozilla.org mdn.dev interactive-examples.mdn.mozilla.net interactive-examples.mdn.allizom.net wikipedia.org upload.wikimedia.org https://mdn.github.io/shared-assets/ https://mdn.dev/ https://*.google-analytics.com https://*.googletagmanager.com www.gstatic.com; manifest-src 'self'; media-src 'self' archive.org videos.cdn.mozilla.net https://mdn.github.io/shared-assets/; child-src 'self'; worker-src 'self';
x-frame-options: DENY
origin-trial: AxVILwizhbMjxFeHOn1P3R8niO1RJY/smaK4B4d1rLzc1gTaxtXMSaTi+FoigYgCw40uFRDwFcEAeqDR+vVLOW4AAABfeyJvcmlnaW4iOiJodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZyIsImZlYXR1cmUiOiJQcml2YXRlQXR0cmlidXRpb25WMiIsImV4cGlyeSI6MTc0MjA3OTYwMH0=
x-cloud-trace-context: 751a337ac46686b6e72bc4e3df0151f0
date: Fri, 10 Oct 2025 20:04:57 GMT
server: Google Frontend
via: 1.1 google
vary: Accept-Encoding
content-encoding: gzip
x-cache: miss
大なりイコール演算子 (>=) - JavaScript | MDN
Toggle sidebar
>
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
大なりイコール演算子 (>=)
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
大なりイコール演算子 (>=
) は、左オペランドが右オペランド以上の場合は true
を返し、それ以外の場合は false
を返します。
試してみましょう
console.log(5 >= 3);
// 予想される結果: true
console.log(3 >= 3);
// 予想される結果: true
// Compare bigint to number
console.log(3n >= 5);
// 予想される結果: false
console.log("ab" >= "aa");
// 予想される結果: true
構文
js
x >= y
解説
オペランドは、小なり演算子と同じアルゴリズムを使用して比較され、結果が反転されます。 x >= y
は通常 !(x < y)
と同等ですが、 x >= y
と x < y
の両方が false
となる 2 つの例外があります。
- 一方のオペランドが長整数に変換される一方、もう一方が長整数値に変換できない(
BigInt()
に渡すと構文エラーを発生する)文字列に変換される場合。 - オペランドの一方が
NaN
に変換される場合。(例えば、数値に変換できない文字列やundefined
など。)
x >= y
は、一般的に x > y || x == y
と同等ですが、次のいくつかの例外があります。
x
またはy
のいずれかがnull
で、もう一方がnull
ではなく、数値型への変換によって 0 になる値(0
、0n
、false
、""
、"0"
、new Date(0)
など)の場合、x >= y
はtrue
と評価され、x > y || x == y
はfalse
と評価されます。x
またはy
の一方がundefined
で、もう一方がnull
またはundefined
である場合、x >= y
はfalse
となる一方、x == y
はtrue
となります。x
とy
が同じオブジェクトであり、小なり演算の最初の段階の後でNaN
になる場合(new Date(NaN)
など)、x >= y
はfalse
となる一方、x == y
はtrue
となります。x
とy
が異なるオブジェクトであり、小なり演算の最初の段階の後、同じ値になる場合、x >= y
はtrue
となる一方、x > y || x == y
はfalse
となります。
例
>文字列と文字列の比較
js
"a" >= "b"; // false
"a" >= "a"; // true
"a" >= "3"; // true
文字列と数値の比較
js
"5" >= 3; // true
"3" >= 3; // true
"3" >= 5; // false
"hello" >= 5; // false
5 >= "hello"; // false
数値と数値の比較
js
5 >= 3; // true
3 >= 3; // true
3 >= 5; // false
数値と長整数の比較
js
5n >= 3; // true
3 >= 3n; // true
3 >= 5n; // false
論理値、null、undefined、NaN の比較
js
true >= false; // true
true >= true; // true
false >= true; // false
true >= 0; // true
true >= 1; // true
null >= 0; // true
1 >= null; // true
undefined >= 3; // false
3 >= undefined; // false
3 >= NaN; // false
NaN >= 3; // false
仕様書
Specification |
---|
ECMAScript® 2026 Language Specification> # sec-relational-operators> |
ブラウザーの互換性
Loading…