Immutability
Immutability is a very simple concept but very important to Functional Programming. The textbook definition of immutability is simply "something that is not changeable." In programming, we use the word to mean objects and variables whose state cannot be changed after they have been created.
In software development, values can be passed into functions by reference. When a variable is passed by reference, it means that a reference to the memory location (a pointer) is passed instead of the serialized value of the object contained at that location in memory. Since all of the pointers for a variable passed by reference point to the same block of memory, any update to the value of the variable passed by reference will be seen by any pointer pointing to that block of memory. Any variable passed by reference instead of by value can be considered a shared state, since it can be modified by multiple separate scopes. It is important to write functions that prevent the mutation of data...