Figure 3.24
Lists x: list(list("a", "b"), "c", "d") and y: list("e", "f").
Figure 3.26
Effect of set_head(x, y) on the lists in figure 3.24.
Figure 3.28
Effect of const z = pair(y, tail(x)); on the lists in figure 3.24.
Figure 3.30
Effect of set_tail(x, y) on the lists in figure 3.24.

[1]
The functions set_head and set_tail return the value undefined. They should be used only for their effect.
[2]
We see from this that mutation operations on lists can create garbage that is not part of any accessible structure. We will see in section 5.3.2 that JavaScript memory-management systems include a garbage collector, which identifies and recycles the memory space used by unneeded pairs.
[3]
Section 5.3.1 will show how a memory-management system can implement get_new_pair.
[4]
The two pairs are distinct because each call to pair returns a new pair. The strings are the same in the sense that they are primitive data (just like numbers) that are composed of the same characters in the same order. Since JavaScript provides no way to mutate a string, any sharing that the designers of a JavaScript interpreter might decide to implement for strings is undetectable. We consider primitive data such as numbers, booleans, and strings to be identical if and only if they are indistinguishable.
[5]
The subtleties of dealing with sharing of mutable data objects reflect the underlying issues of sameness and change that were raised in section 3.1.3. We mentioned there that admitting change to our language requires that a compound object must have an identity that is something different from the pieces from which it is composed. In JavaScript, we consider this identity to be the quality that is tested by ===, i.e., by equality of pointers. Since in most JavaScript implementations a pointer is essentially a memory address, we are solving the problem of defining the identity of objects by stipulating that a data object itself is the information stored in some particular set of memory locations in the computer. This suffices for simple JavaScript programs, but is hardly a general way to resolve the issue of sameness in computational models.
[6]
On the other hand, from the viewpoint of implementation, assignment requires us to modify the environment, which is itself a mutable data structure. Thus, assignment and mutation are equipotent: Each can be implemented in terms of the other.
3.3.1  
Mutable List Structure