大なりイコール演算子 (>=) は、左辺のオペランドが右辺のオペランド以上の場合は true を返し、それ以外の場合は false を返します。
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
構文
x >= y
解説
例
文字列と文字列の比較
console.log("a" >= "b"); // false
console.log("a" >= "a"); // true
console.log("a" >= "3"); // true
文字列と数値の比較
console.log("5" >= 3); // true
console.log("3" >= 3); // true
console.log("3" >= 5); // false
console.log("hello" >= 5); // false
console.log(5 >= "hello"); // false数値と数値の比較
console.log(5 >= 3); // true
console.log(3 >= 3); // true
console.log(3 >= 5); // false数値と BigInt の比較
console.log(5n >= 3); // true
console.log(3 >= 3n); // true
console.log(3 >= 5n); // falseブール値、 null 、 undefined 、 NaN の比較
console.log(true >= false); // true
console.log(true >= true); // true
console.log(false >= true); // false
console.log(true >= 0); // true
console.log(true >= 1); // true
console.log(null >= 0); // true
console.log(1 >= null); // true
console.log(undefined >= 3); // false
console.log(3 >= undefined); // false
console.log(3 >= NaN); // false
console.log(NaN >= 3); // false仕様
ブラウザーの互換性
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.