Hacker News new | ask | show | jobs
by tracker1 3107 days ago

  Array.from(document.querySelectorAll('.myclass'))
    .forEach(el => el.style.display = 'block')
1 comments

Though ie11 doesn't have Array.from()
Hrmmm... maybe someone should make a library that would smooth over browser differences and provide a consistent element selection syntax? Call it JavascriptSelection, or jSelection?
imho 'JavascriptQuery' or 'jQuery' sounds better, oh wait...
I tend to polyfill older browsers, Array.from is a pretty small one. Sad thing is at a point where it's probably worth it to have 2-3 builds in place... 1 for legacy browsers, one for modern without modules, and one for modules/import/http2 support.

Just haven't taken the time... at least the main app I work on at work doesn't need to support IE11. Latest Edge,, Firefox, Safari and Chrome ... and Chrome is the primary target.