fix(curriculum): misleading explanation of compound assignment operators (#65751)

Co-authored-by: SilentDeath53 <SilentDeath53@users.noreply.github.com>
This commit is contained in:
SilentDeath53 2026-02-10 12:23:49 +03:00 committed by GitHub
parent 41a1c78e84
commit d453de6fda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,7 +7,7 @@ dashedName: what-are-compound-assignment-operators-in-javascript-and-how-do-they
# --interactive--
In JavaScript, all arithmetic operators have a compound assignment form. Compound assignment operators allow you to perform a mathematical operation and reassign the result back to the variable in one line of code. Instead of writing something like this:
In JavaScript, all arithmetic operators have a compound assignment form. Compound assignment operators provide a concise shorthand for an operation on a variable followed by storing the result in that same variable. They combine the operation and assignment into a shorter form like `x += y`, which is equivalent to writing `x = x + y` but without repeating the variable name. Instead of writing something like this:
:::interactive_editor
@ -126,7 +126,7 @@ Think about how to combine mathematical operations and reassignment.
---
Perform a mathematical operation and reassign the result to the variable in one line of code.
Provide a shorter way to perform an operation on a variable and assign the result back to that same variable.
---