[whatwg/dom] Proposal: ParentNode.empty() (#478)

The **ParentNode.empty()** method would remove all child nodes from the parent node.

### Syntax

```js
ParentNode.empty();
```

### Rationale:

Like `append()`, `prepend()`, `before()`, `after()`, and `replaceWith()`, we’re allowing developers to do something useful without a loop, e.g:

```js
while (parentNode.lastChild) {
  parentNode.removeChild(parentNode.lastChild);
}
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/478

Received on Tuesday, 18 July 2017 02:40:46 UTC