> ## 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 Multiplication Assignment

The multiplication assignment operator (`*=`) multiplies the current value of a variable by the value of the right operand and assigns the computed product back to the variable. It is a compound assignment operator that functions as syntactic sugar for standard multiplication and assignment.

```javascript theme={"dark"}
LeftHandSideExpression *= AssignmentExpression
```

Conceptually, `x *= y` is equivalent to `x = x * y`, with the distinction that the `LeftHandSideExpression` is evaluated only once.

## Evaluation Mechanics

When the JavaScript engine encounters the `*=` operator, it executes the following sequence according to the ECMAScript specification:

1. Evaluates the `LeftHandSideExpression` to resolve its memory reference.
2. Retrieves the current value stored at the left-hand reference.
3. Evaluates the `AssignmentExpression` (the right operand) to determine its value.
4. Applies the standard multiplication operation (`*`) to both values.
5. Assigns the resulting product back to the left-hand reference.

## Type Coercion

Because the underlying operation is strictly mathematical, the `*=` operator forces implicit numeric coercion on both operands before calculating the product. JavaScript attempts to convert non-numeric types using the internal `ToNumber` abstract operation.

* **Strings:** Parsed for numeric literals. If a variable `x` holds `"5"`, executing `x *= "2"` results in `10`. If the string cannot be parsed (e.g., `"foo"`), it coerces to `NaN`.
* **Booleans:** `true` coerces to `1`, and `false` coerces to `0`.
* **Null:** Coerces to `0`.
* **Undefined:** Coerces to `NaN`.

```javascript theme={"dark"}
let a = 5;
a *= 3; 
// a is now 15 (Standard numeric multiplication)

let b = "10";
b *= "4"; 
// b is now 40 (Both strings coerced to Numbers)

let c = 5;
c *= "hello"; 
// c is now NaN (Right operand coerced to NaN, 5 * NaN = NaN)

let d = 10;
d *= true; 
// d is now 10 (true coerced to 1)

let e = 5;
e *= null; 
// e is now 0 (null coerced to 0)
```

## BigInt Behavior

The `*=` operator supports `BigInt` primitives, but strict type matching is required. JavaScript does not implicitly coerce between `Number` and `BigInt`. Both operands must be of the same type, otherwise the engine throws a `TypeError`.

```javascript theme={"dark"}
let bigVal = 5n;
bigVal *= 3n; 
// bigVal is now 15n

let mixedVal = 5n;
mixedVal *= 3; 
// TypeError: Cannot mix BigInt and other types, use explicit conversions
```

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