> ## 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.

# JavaScript Greater Than

The greater than (`>`) operator is a binary relational operator that evaluates whether its left operand is strictly greater than its right operand, returning a boolean (`true` or `false`).

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

When evaluating the expression, JavaScript engine applies the **Abstract Relational Comparison** algorithm. This process dictates how different data types are coerced and compared:

1. **Primitive Conversion (`ToPrimitive`)**: Both operands are converted to primitive values. If an operand is an object, JavaScript attempts to convert it by calling its `valueOf()` and `toString()` methods, prioritizing numeric conversion.
2. **String Comparison**: If both resulting primitives are strings, they are compared lexicographically based on their UTF-16 code unit values.
3. **Numeric Conversion (`ToNumeric`)**: If at least one of the primitives is not a string, both operands are coerced into numeric values (either `Number` or `BigInt`).
4. **`NaN` Evaluation**: If either operand coerces to `NaN` (Not-a-Number), the operator strictly returns `false`.
5. **Zero Evaluation**: JavaScript treats `+0` and `-0` as mathematically equal; neither is greater than the other.

## Mechanical Examples

**Strict Numeric Comparison**
Compares standard IEEE 754 double-precision floats or BigInts.

```javascript theme={"dark"}
5 > 3;       // true
-1 > 0;      // false
10n > 9;     // true (BigInt and Number can be compared safely)
```

**Lexicographical String Comparison**
Compares UTF-16 code units from left to right.

```javascript theme={"dark"}
"b" > "a";   // true (98 > 97)
"Z" > "a";   // false (90 > 97 - uppercase letters have lower code units)
"10" > "2";  // false (Compares "1" and "2", 49 > 50 is false)
```

**Type Coercion (Mixed Types)**
Forces numeric conversion when types do not match.

```javascript theme={"dark"}
"5" > 3;     // true  (String "5" coerces to Number 5)
true > false;// true  (Boolean true coerces to 1, false to 0)
null > -1;   // true  (null coerces to 0)
```

**Object Coercion**
Objects are reduced to primitives before comparison.

```javascript theme={"dark"}
[5] > 4;     // true  (Array [5] coerces to String "5", then Number 5)
["a"] > 0;   // false (Array ["a"] coerces to "a", then NaN. NaN > 0 is false)
```

**NaN Handling**
Any comparison involving `NaN` yields `false`.

```javascript theme={"dark"}
NaN > 5;     // false
5 > NaN;     // false
NaN > NaN;   // false
undefined > 0; // false (undefined coerces to NaN)
```

<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 JavaScript 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>
