DEV Community

Discussion on: JavaScript loop querySelectorAll results

Collapse
 
sleeplessbyte profile image
Derk-Jan Karrenbeld

Good list of the options!

Instead of [].forEach, I believe the recommended "support old browsers" variant is:

Array.prototype.forEach.call(list, function (item) {
  ...
});
Enter fullscreen mode Exit fullscreen mode
Collapse
 
dailydevtips1 profile image
Chris Bongers

Ah yes if you need to fully support every single browser indeed.
I gave up on IE support, so didn't even include this, but you are right!

Collapse
 
sleeplessbyte profile image
Derk-Jan Karrenbeld

I use death-to-ie11.com/ often; and charge customers/clients 2x if they want IE support!

So I'm with you :D

Thread Thread
 
dailydevtips1 profile image
Chris Bongers

Nice! Good tip on charging double haha

Thread Thread
 
sleeplessbyte profile image
Derk-Jan Karrenbeld

I recommend it!

Don't bin IE because you (and I) hate it, but giving that it will take you about twice as long, charge double!

Thread Thread
 
dailydevtips1 profile image
Chris Bongers

100% working for companies who serve big old-school companies you have to.
They often use IE because of their 90's it setup.