Personally I'd make everything const instead of let and use for of instead of forEach, but it's like 10 lines of code it doesn't really matter.

Are you sure this old API does the right thing with for…of?

It's only used to iterate the array

Oops, right, I confused the variables.

Should 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/HTMLTableEl...