upvote
You don't need Array.from if you are using `for (const x of document.querySelectorAll(selector) { }` loops anyway or have a library like IxJS handy.

ES2025 added map, filter, flatMap, reduce, forEach, and several other methods to all iterators (including NodeList directly, I believe, but definitely its entries(), keys(), values(), if not) [1]. It'll be a year or two at current pace before that is "widely accepted baseline" in browsers, but it's great progress on these sorts of complaints.

[1] https://2ality.com/2025/06/ecmascript-2025.html#iterator-hel...

reply
I agree that DOM lists not being real arrays is a pita. I can understand why for getElementBy* methods which return live lists, but it's less clear for those methods returning fixed lists.

But to me, these are minor inconveniences and habits. A thin wrapper can get you there easily if you care enough. I personally dislike this array/element confusion that jQuery adds.

reply
> A thin wrapper can get you there easily if you care enough

But that's more and more friction. A wrapper here, a wrapper there, and if here, a try/catch there. At one point you are reinventing significant chunks of jQuery

reply
jQuery's scope is broad¹. It has at least:

- a plugin system

- its custom selector parser (because it had it before querySelector and is not totally compatible with it)

- its abstraction to iron out browser differences (old IE vs standard, notably) that's not relevant anymore

- its own custom (DOM) event management

- its implementation of methods that are now standard (ajax & trim for instance)

I recognize that the DOM API could be better, and comes with friction. Back then, ironing out the browser differences and its selector feature were killer features of jQuery. Today, I do not think the quirks of the DOM API warrant importing a library like jQuery.

¹ but indeed, very lightweight compared to modern frameworks like Angular, React and Vue, with all the ecosystem which comes with each of them (react-router, redux, etc).

reply