In ES6, an iterable is an object that allows for... of, and has a Symbol.iterator key.
Arrays are iterables, as are Sets and Maps. The question is: are
For anyone arriving here from trying to iterate on NodeList using TypeScript. I found this issue with the fix https://github.com/microsoft/TypeScript/issues/4947 and this is the tsconfig.json you'll need for it:
{
"compilerOptions": {
"lib": ["es2017", "dom", "dom.iterable"],
"downlevelIteration": true
}
}
The problem error I was getting:
Type 'NodeListOf' is not an array type.
And this was the code that was triggering that problem:
[...document.querySelectorAll('#md-view a')]