querySelectorAll

querySelectorAll (same as getElements?By((Tag|Class)Name|Id)) returns NodeList which is not an instance of Array and thus has no methods to iterate over. The best thing we can do about this is:


[].forEach.call(
    document.querySelectorAll(".shit"), 
    function(e){
        this.log(e);
    },
    { log: console.log }
);

Where forEach can be replaced with any of array methods like: forEach, map, filter, some, every, reduce, reduceRight