Guest User

Untitled

a guest
Apr 25th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. const forEach = function (callback) {
  2. const array = this;
  3. for (let i = 0; i < array.length; i++) {
  4. const element = array[i];
  5. callback(element, i, array);
  6. }
  7. };
  8. 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