@ungap/dom-iterable
Version:
Ensuring common iterable DOM classes can be used in for/of loops.
18 lines (12 loc) • 888 B
Markdown
# DOM Iterable
[](https://travis-ci.com/ungap/dom-iterable) [](https://coveralls.io/github/ungap/dom-iterable?branch=master) [](https://greenkeeper.io/) 
Ensuring common iterable DOM classes can be used in for/of loops.
```js
// works from Chrome 51 on, not before
for (const node of document.querySelectorAll('*'))
console.log(node);
```
* CDN via https://unpkg.com/@ungap/dom-iterable
* ESM via `import iterator from '@ungap/dom-iterable'`
* CJS via `const iterator = require('@ungap/dom-iterable')`
[Live test](https://ungap.github.io/dom-iterable/test/)