Rick Waldron 05 December 2013 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.
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.