News for hackers. Stuff that matters.
Re:jQuery 4.1.0 by Kuyawa on Tuesday November 17, 2026 @04:38PM (#50538550)
replace jquery with

  $ = (q) => document.querySelector(q)
and

  $$ = (q) => document.querySelectorAll(q)
and you're good to go
Re:jQuery 4.1.0 by troupo on Tuesday November 17, 2026 @04:48PM (#50538692)
No, you're not.

jQuery returned useful collections. DOM methods return an anemic NodeList which doesn't even implement Array interface.

Re:jQuery 4.1.0 by Kuyawa on Tuesday November 17, 2026 @04:51PM (#50538740)

  $('body').childNodes.forEach(console.log)
I see a beautiful collection there
Re:jQuery 4.1.0 by troupo on Tuesday November 17, 2026 @04:54PM (#50538767)
NodeList 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

Re:jQuery 4.1.0 by kuschku on Tuesday November 17, 2026 @05:09PM (#50538947)
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.
Re:jQuery 4.1.0 by hajile on Tuesday November 17, 2026 @08:29PM (#50540716)
NodeList has .values() that returns an iterator.

    var $$ = q => document.querySelectorall(q).values()
Then you have access to a bunch of iterator methods

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...