7 Updating data destructively and non-destructively
In this chapter, we learn about two different ways of updating data:
- A destructive update of data mutates the data so that it has the desired form.
- A non-destructive update of data creates a copy of the data that has the desired form.
The latter way is similar to first making a copy and then changing it destructively, but it does both at the same time.