Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodelist-foreach-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodelist-foreach-polyfill - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

CHANGELOG.md

13

index.js

@@ -1,5 +0,8 @@

NodeList.prototype.forEach = function(callback) {
for (var i = 0; i < this.length; i++) {
callback.call(this, this[i], i, this);
}
}
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = function (callback, argument) {
argument = argument || window;
for (var i = 0; i < this.length; i++) {
callback.call(argument, this[i], i, this);
}
};
}
{
"name": "nodelist-foreach-polyfill",
"version": "1.0.0",
"version": "1.1.0",
"description": "Simple polyfill for the NodeList.forEach method.",

@@ -5,0 +5,0 @@ "main": "index.js",

# NodeList.forEach polyfill
Simple polyfill for the `NodeList.forEach` method.
MDN polyfill for the `NodeList.forEach` method.
It means you can use `forEach` on `document.querySelectorAll` and other similar functions that return `NodeList`.
It polyfills `forEach` support for `NodeList` objects (a common result of `document.querySelectorAll`).
## Native support
Chrome 51, Firefox 50, Opera 38, Safari 10

@@ -16,2 +17,2 @@

Import before any usages of `document.querySelectorAll("#foo").forEach((elem) => { ... })` etc
Import before any usages of `document.querySelectorAll("#foo").forEach((elem) => { ... })` etc.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc