In this chapter, we have seen two different approaches (actually used by commonly available immutability libraries) to avoiding side-effects by working with immutable objects and data structures: one was based on using JavaScript's object freezing plus some special logic for cloning and the other applied the concept of persistent data structures, with methods that allowed all kinds of updates without either changing the original or requiring full cloning.
In Chapter 11, Implementing Design Patterns - The Functional Way, we will focus on a question often asked by object-oriented programmers: how are design patterns used in FP? Are they required, available, or usable? Are they still practiced but with a new focus on functions rather than on objects? We'll answer these questions with several examples showing where and how they are equivalent or they differ from...