A new selection method was introduced with version 1.4 of the d3-selection module: join(). It automatically matches data items and elements, appending and removing elements as necessary, and eliminating the need for explicit calls to enter(), exit(), append(), order(), and remove(). It makes data binding much simpler, and methods such as merge() unnecessary and candidates for deprecation in future versions.
That said, it's still important that you understand the general update pattern as described in the previous section, since most code examples you will find online and in this book still use it (it was added to D3 when most of this book was already written). It will also be easier to understand how join() works if you are familiar with the general update pattern. But you can and should use it whenever possible.
Consider the following HTML used in previous examples...