When looking at the ECMAScript compatibility table, it says that Edge 15 and Edge 16 support for ... of
loops.
However, when I run this code:
const list = document.querySelectorAll('[data-test]');
console.log(list);
for (const item of list) {
console.log(item);
}
<div data-test></div>
<div data-test></div>
<div data-test></div>
<div data-test></div>
<div data-test></div>
It works in Chrome and Firefox, but not in Edge. Instead it says:
Object doesn't support property or method 'Symbol.iterator'.
As I understand it, NodeList
actually should support it, right?
Here's a fildde to try it yourself: Test it online
Can somebody explain the problem or the mistake here?