remove method
Removes the selected elements from the document.
Returns this selection (the removed elements) which are now detached from the DOM. There is not currently a dedicated API to add removed elements back to the document; however, you can pass a function to selection.append or selection.insert to re-add elements.
Implementation
Selection remove() {
return each(_remove);
}