Skip to content

24 ways to impress your friends

Vote up?

Rick Waldron

Great article!

Just a minor correction to your qsa-forEach example:

@
var counters = document.querySelectorAll(‘.counter’);
[].forEach.call(counters, function (elem, index) { elem.textContent = index + 1;
});
@

Most Array prototype methods are generic, so slicing is unnecessary.