24 ways to impress your friends

Jump to menu

Vote down?

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.