Need private packages and team management tools?Check out npm Teams »

nodelist-foreach-polyfill

1.2.0 • Public • Published

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);
});

Install

npm i nodelist-foreach-polyfill

DownloadsWeekly Downloads

23,705

Version

1.2.0

License

ISC

Last publish

Collaborators

  • avatar