We learned in Chapter 2, Understanding Pure Functions, that pure functions have three characteristics:
- They always return the same values for the same argument values
- They don't have side effects
- They don't change the values of their parameters
We also discovered that we need to pay attention to immutability when writing pure functions. This is easy, as long as we remember where to place the const keyword.
So, how do lambdas deal with immutability? Do we have to do anything special or do they just work?