Array.from(document.querySelectorAll(".some-class")).forEach(function (element, index, array) { ... });