PRO
Anna
asked

Expert
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.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer
