# Modify-In-Place in JavaScript

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676449566647/317f7310-bde5-4be2-8148-d569b56aabb2.png align="center")

The value in the variable "num" can be replaced in another line of code.

i.e.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676449721087/a50491ca-9bfb-4dcf-baea-66343c0fd340.png align="center")

But, what if you intend to update the value in a variable instead of replacing it?

For instance, you might want to increase the value stored in a variable, so instead of replacing the value, you can easily update it. This process is known as <mark>Modify-in-place</mark>.

Modify-in-place works with all arithmetic operators.

**For addition: "+="**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676450810377/9d753136-d84b-4031-aea5-a2e1f1ad9c50.png align="center")

**For subtraction: "-="**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676451001200/e76dc0c9-cfc3-448c-9d9b-95e0545ffe98.png align="center")

**For multiplication: "\*="**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676451110343/76038b92-0a20-479e-af10-a543872ac0ea.png align="center")

**For division: "/="**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676450679321/72b875c3-97ce-48e2-876b-1b5d12e7542e.png align="center")

**For exponentiation: "\*\*="**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676451245467/8b4d47d7-7368-4c41-8537-3eca867bc4a6.png align="center")

**For modulus: "%="**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1676451415920/ade9e309-5a4e-446e-817b-770232e5b118.png align="center")

In summary, modify-in-place is a process that makes code look neat and shorter.
