3 ms·
Are you sure this old API does the right thing with for…of?
by Sharlin 1y ago
Are you sure this old API does the right thing with for…of?
- kaoD 1y agoIt's only used to iterate the array
- Sharlin 1y agoOops, right, I confused the variables.
- runarberg 1y agoShould work just fine: > document.createElement("table").rows[Symbol.iterator]() // Array Iterator { constructor: Iterator() } HTMLTableElement.prototype.rows actually just returns a HTMLCollection, so same as document.forms, or document.getElementsByClassName. HTMLCollection implements Symbol.iterator as you would expect. https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableElement/rows https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableEl...