internetee/registry

View on GitHub
app/assets/javascripts/polyfills/node_list_for_each.js

Summary

Maintainability
A
0 mins
Test Coverage
// Needed mainly for IE11
// https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach

if (window.NodeList && !NodeList.prototype.forEach) {
    NodeList.prototype.forEach = function (callback, thisArg) {
        thisArg = thisArg || window;
        for (var i = 0; i < this.length; i++) {
            callback.call(thisArg, this[i], i, this);
        }
    };
}