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

The division operator (`/`) is a binary arithmetic operator that calculates the quotient of its left operand (dividend) divided by its right operand (divisor). For standard numbers, which are implemented as double-precision 64-bit floating-point values (IEEE 754), the division operator yields a floating-point result, retaining fractional components rather than implicitly truncating to an integer.

```javascript theme={"dark"}
dividend / divisor
```

## Type Coercion

If either operand is not of type `Number` or `BigInt`, JavaScript evaluates the expression by implicitly coercing the operands using the abstract `ToNumeric` operation. The distinction of using `ToNumeric` rather than `ToNumber` is critical because `ToNumeric` allows object wrappers of BigInts (e.g., `Object(5n)`) to be correctly unboxed to `BigInt` primitives rather than being forced into `Number` types. If an operand cannot be successfully coerced into a valid numeric value, the operation evaluates to `NaN`.

```javascript theme={"dark"}
10 / "2"         // 5 (String "2" is coerced to Number 2)
10 / true        // 10 (Boolean true is coerced to Number 1)
10 / null        // Infinity (null is coerced to Number 0)
10 / "text"      // NaN ("text" coerces to NaN)
10n / Object(2n) // 5n (Object wrapper unboxed to BigInt via ToNumeric)
```

## Floating-Point Exceptions and Special Values

For standard `Number` types, JavaScript does not throw a runtime exception for division by zero. Instead, it adheres to IEEE 754 specifications for special numeric values:

* **Division by Zero:** Dividing a non-zero positive number by `0` yields `Infinity`. Dividing a non-zero negative number by `0` yields `-Infinity`.
* **Zero by Zero:** Dividing `0` by `0` yields `NaN`.
* **Infinity:** Dividing any finite number by `Infinity` or `-Infinity` yields `0` or `-0`. Dividing `Infinity` by `Infinity` yields `NaN`.

```javascript theme={"dark"}
 5 / 0               // Infinity
-5 / 0               // -Infinity
 0 / 0               // NaN
 5 / Infinity        // 0
 Infinity / Infinity // NaN
```

## BigInt Evaluation

When both operands are `BigInt` primitives, the `/` operator performs integer division. The result is always truncated towards zero, discarding any fractional remainder.

Unlike standard `Number` evaluation, dividing a `BigInt` by `0n` explicitly throws a `RangeError`.

```javascript theme={"dark"}
10n / 3n      // 3n
-10n / 3n     // -3n
5n / 0n       // RangeError: Division by zero
```

Attempting to mix `BigInt` and `Number` types across the `/` operator without explicit casting will throw a `TypeError`, as JavaScript does not implicitly coerce between these two distinct numeric types.

```javascript theme={"dark"}
10n / 2       // TypeError: Cannot mix BigInt and other types
```

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