Nearby lessons
9 of 40🔸 Assignment Operators
📌 What are Assignment Operators?
Assign values to variables and perform operations simultaneously.
Combine arithmetic operations with assignment for concise code.
| Attribute | Description |
|---|---|
= | Simple assignment (e.g., x = 10) |
+= | Add and assign (e.g., x += 5) |
-= | Subtract and assign (e.g., x -= 5) |
*= | Multiply and assign (e.g., x *= 5) |
/= | Divide and assign (e.g., x /= 5) |
%= | Modulus and assign (e.g., x %= 5) |
**= | Exponent and assign (e.g., x **= 5) |
Code Example
PREVIEW READY
Keep Going!JS - Comparison Operators