NodeList.prototype.forEach = function() { for(var i =0; i<this.length; i++) { console.log(this[i].textContent); } } let x = document.querySelectorAll(".myclass"); x.forEach();