Dealing with Mutable Data

In JavaScript Objects are mutable, which simply means they can be changed. I think the first time I heard this statement I thought “Yeah, so big deal.”. Well, it can be a big deal if you don’t understand what that mutable nature means. It can cause unexpected issues.

In this tutorial that I recently published I talk about the issues you can run into and provide some examples. The examples shows how the mutable nature of objects can cause some unexpected consequences.

I then followed up this tutorial with a second tutorial that shows a possible solution. The solution is cloning objects. This is a technique commonly used in functional programming and is great to be aware of. I think the two tutorials together can be a great help.

What tutorials would you like to see?