JSPM

nodelist-foreach-polyfill

1.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12798
  • Score
    100M100P100Q144242F
  • License ISC

Simple polyfill for the NodeList.forEach method.

Package Exports

  • nodelist-foreach-polyfill

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nodelist-foreach-polyfill) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

NodeList.forEach polyfill

Provides a polyfill for Nodelist.prototype.forEach() to all Browsers supporting ES5.

Native support

Chrome 51, Firefox 50, Opera 38, Safari 10
Android Browser none, IE Mobile none, IE none
See MDN for more information.

Import

// CommonJS
require('nodelist-foreach-polyfill');

// ES6 Modules import / Typescript import
import 'nodelist-foreach-polyfill';

Usage

// Get Nodelist from DOM via document.querySelectorAll()
var elements = document.querySelectorAll('.foo');

// Loop through nodelist
elements.forEach(function(element, index, nodelist) {
    console.log(this, element, index, nodelist);
});