3 The destructuring algorithm
In this chapter, we look at destructuring from a different angle: as a recursive pattern matching algorithm.
The algorithm will give us a better understanding of default values. That will be useful at the end, where we’ll try to figure out how the following two functions differ:
function move({x=0, y=0} = {}) { ··· }
function move({x, y} = { x: 0, y: 0 }) { ··· }