> ## 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 Unsigned Right Shift Assignment

The `>>>=` (Unsigned Right Shift Assignment) operator evaluates the binary representation of its left operand, shifts it to the right by the number of bits specified by the right operand, fills the vacated leftmost bits with zeroes, and assigns the resulting 32-bit unsigned integer back to the left operand.

## Syntax

```typescript theme={"dark"}
x >>>= y
```

This is the compound assignment equivalent of:

```typescript theme={"dark"}
x = x >>> y
```

## Technical Behavior

1. **32-bit Conversion:** Before the shift operation, TypeScript (inheriting from JavaScript) implicitly converts the left operand into a 32-bit unsigned integer. The right operand is converted to a 32-bit integer.
2. **Zero-Fill:** Unlike the sign-propagating right shift (`>>`), the unsigned right shift (`>>>`) does not preserve the sign bit. It strictly pushes `0`s in from the left. Consequently, the result of this operation is always a non-negative 32-bit integer, even if the initial left operand was a negative number.
3. **Modulo 32 Masking:** The right operand is masked to 5 bits (`y & 0x1F`). This means the shift amount is strictly evaluated as a value between `0` and `31`. Shifting by `32` is equivalent to shifting by `0`.
4. **BigInt Incompatibility:** Unlike other bitwise operators (such as `>>`, `<<`, `&`, `|`), the unsigned right shift is strictly prohibited for `bigint` types. Because `bigint` values are arbitrary-precision and lack a fixed bit-width, there is no defined "left edge" to fill with zeroes. Attempting to use `>>>=` with a `bigint` will throw compiler error `TS2779`.

## Code Visualization

**Example 1: Positive Integer**

```typescript theme={"dark"}
let x: number = 10; 
// 32-bit binary: 00000000000000000000000000001010

x >>>= 2; 
// Shifts right by 2, fills left with two 0s.
// 32-bit binary: 00000000000000000000000000000010
// x evaluates to 2
```

**Example 2: Negative Integer (Demonstrating Zero-Fill)**

```typescript theme={"dark"}
let y: number = -10; 
// 32-bit binary (Two's complement): 11111111111111111111111111110110

y >>>= 1; 
// Shifts right by 1, forces a 0 into the sign bit.
// 32-bit binary: 01111111111111111111111111111011
// y evaluates to 2147483643
```

**Example 3: Modulo 32 Shift**

```typescript theme={"dark"}
let z: number = 5;
// 32-bit binary: 00000000000000000000000000000101

z >>>= 32; 
// 32 & 0x1F evaluates to 0. Shifts right by 0.
// z remains 5
```

**Example 4: BigInt Exception**

```typescript theme={"dark"}
let b: bigint = 10n;

b >>>= 2n; 
// Error: TS2779: The '>>>' and '>>>=' operators cannot be applied to 'bigint'.
```

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