0d: 00h: 00m: 00s

🎁 Get 3 extra months of learning β€” completely FREE

That's 90 extra days to master new skills, build more projects, and land your dream job.

Become a PRO
Background Image

🎁 Get 3 extra months of learning completely FREE

Become a PRO
Anna
PRO
2 weeks ago
Annacountry asked

What does the *= operator mean in programming?

Abhay Jajodia
Expert
last week
Abhay Jajodia answered

Hello Anna, really nice question.

*= is just a shortcut for multiplying a variable by something and then storing the new value back into that same variable. It follows the same pattern as +=, which adds to the existing value.

So instead of writing:

x = x * 5

you can write:

x *= 5

Both do exactly the same thing β€” the second one is just shorter and easier to read once you get used to it.

If you have further questions, I'm here to help.

JS
This question was asked as part of the Learn JavaScript Basics course.