News for hackers. Stuff that matters.
Re:How to manage HTML DOM with vanilla JavaScript only? by stasgavrylov on Thursday April 02, 2020 @10:17AM (#22759221)
Great resource. I'm wondering whether the examples are your own or copied from across the web?

I just wanted to point out that some of them are a bit outdated, and I belive it'd be nice to maintain this list as a reference with modern approaches.

For example, there's no need to use `appendChild`, because DOM today has a more versatile `append` method.

And `[].forEach.call(cols, function(col) {...}` would look much better and more declarative as `for (const col of cols) { ... }`.

These are just first 2 examples that I noticed.

Re:How to manage HTML DOM with vanilla JavaScript only? by drdec on Thursday April 02, 2020 @11:13AM (#22759920)
Your proposed changes are not supported in IE 11. The snippets are advertised as IE 11+ compatible on the landing page.
Re:How to manage HTML DOM with vanilla JavaScript only? by stasgavrylov on Thursday April 02, 2020 @11:37AM (#22760167)
You're correct, but let/const don't have full support in IE11 either. I understand that people are still supporting IE, but still, this website could stay relevant longer if the examples were written in ESNext.