Mozilla states that \"for of loops will loop over NodeList objects correctly\". (source: https://developer.mozilla.org/en-US/docs/Web/API/NodeList) However, this doesn\'t wo
Since I've successfully used for..of
in Gecko to iterate NodeList
s, it seems this is a browser bug, or at least a browser lack.
Actual working code from a userscript I currently use:
let llnk = document.querySelectorAll("div#threadlist a.threadtitle_unread");
for (let lnk of llnk) {
//...
}
(This also uses let
, but that's another story.)