$('body').childNodes.forEach(console.log)
I see a beautiful collection thereNodeList exposes exactly 5 methods: item, entries, forEach, keys, and values.
Very beautiful.
BTW, browsers didn't even add forEach to it until several years after they added document.querySelectorAll lol
That's why I do
$ = (selector) => Array.from(document.querySelectorAll(selector))
Still not as good as the original, but somewhat usable at least :/
Re:jQuery 4.1.0
by edflsafoiewq on Tuesday November 17, 2026 @05:21PM
(#50539077)
There are small libraries like umbrellajs that just provide a jquery-like DOM interface if that's all you want.
NodeList has .values() that returns an iterator.
var $$ = q => document.querySelectorall(q).values()
Then you have access to a bunch of iterator methodshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
jQuery returned useful collections. DOM methods return an anemic NodeList which doesn't even implement Array interface.