> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript Greater Than Or Equal To

The `>=` (greater than or equal to) operator is a relational comparison operator that evaluates whether its left operand is numerically or lexicographically greater than or equal to its right operand. It strictly returns a `boolean` value (`true` or `false`).

```typescript theme={"dark"}
leftOperand >= rightOperand
```

## TypeScript Type Constraints

While JavaScript allows implicit type coercion across almost all types when using relational operators, TypeScript's static type checker enforces strict operand compatibility to prevent unintended runtime coercion.

To compile successfully, the operands must satisfy one of the following type conditions:

1. **Numeric and BigInt Types (`number`, `bigint`, numeric `enum`):** Operands can be of type `number`, `bigint`, or a numeric `enum` member. TypeScript explicitly allows relational comparisons between `number` and `bigint` types.
2. **String Types (`string`):** Both operands must be of type `string`.
3. **The `any` Type:** If either operand is of type `any`, TypeScript bypasses strict type checking and defers to JavaScript's standard runtime coercion rules.

Attempting to compare incompatible types (e.g., `number` and `string`), types that do not natively support relational comparison in TypeScript (like `boolean`), or object types (like `Date`), results in a compile-time error. To compare objects like `Date` instances, developers must explicitly convert them to comparable primitives.

```typescript theme={"dark"}
// Valid numeric, bigint, and enum comparisons
const isNumGreater: boolean = 10 >= 10;       
const isBigIntGreater: boolean = 100n >= 50n; 
const mixedNumeric: boolean = 10n >= 5; // Valid: bigint and number

enum Level { Low = 1, High = 5 }
const isEnumGreater: boolean = Level.High >= Level.Low;
const isEnumNumGreater: boolean = Level.High >= 3; // Valid: enum and number

// Valid string comparison
const isStrGreater: boolean = "Z" >= "A";     

// Valid Date comparison (requires explicit primitive conversion)
const date1 = new Date("2024-01-02");
const date2 = new Date("2024-01-01");
const isDateGreater: boolean = date1.getTime() >= date2.getTime(); 

// Invalid type comparisons (Compile-time errors)
const invalidDateCompare = date1 >= date2; 
// TS2365: Operator '>=' cannot be applied to types 'Date' and 'Date'.

const mixedStrNum = 10 >= "5"; 
// TS2365: Operator '>=' cannot be applied to types 'number' and 'string'.

const bools = true >= false; 
// TS2365: Operator '>=' cannot be applied to types 'boolean' and 'boolean'.
```

## Evaluation Mechanics

* **Numeric Evaluation (`number`, `bigint`, `enum`):** Evaluates the mathematical value of the operands. If either operand evaluates to `NaN`, the comparison always returns `false`.
* **Lexicographical Evaluation (`string`):** Compares strings character-by-character based on their UTF-16 code unit values. For example, `"b" >= "a"` evaluates to `true` because the code unit for "b" (98) is greater than "a" (97).

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor TypeScript Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
