Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const forEach = function (callback) {
- const array = this;
- for (let i = 0; i < array.length; i++) {
- const element = array[i];
- callback(element, i, array);
- }
- };
- if (!NodeList.prototype.forEach) NodeList.prototype.forEach = forEach // polyfill only if there's no native solution implemented
Add Comment
Please, Sign In to add comment