Prohibits NodeList methods not supported by Chrome<51, Firefox<50, Safari<10, IE & others
📋 This rule is enabled in plugin:mediawiki/common
.
❌ Examples of incorrect code:
element.childNodes.forEach();
element.childNodes.entries();
element.childNodes.keys();
element.childNodes.values();
document.querySelectorAll( '.foo' ).forEach();
✔️ Examples of correct code:
Array.prototype.forEach.call( element.childNodes, function ( element ) {} );
[].forEach();
[].property.forEach();
[].method().forEach();
element.childNodes.item( 1 );
document.querySelectorAll( '.foo' ).item( 1 );
forEach();