Forked from bob-lee/polyfill-ie11-nodelist-foreach.js
Created
January 20, 2021 18:20
-
-
Save juergensaueregger/1930acfd15cf711da4c6613d100a8f12 to your computer and use it in GitHub Desktop.
Polyfill for IE11 missing NodeList.forEach
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ('NodeList' in window && !NodeList.prototype.forEach) { | |
console.info('polyfill for IE11'); | |
NodeList.prototype.forEach = function (callback, thisArg) { | |
thisArg = thisArg || window; | |
for (var i = 0; i < this.length; i++) { | |
callback.call(thisArg, this[i], i, this); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment