Another option is to attach the on method plus Array.prototype.map to the NodeList prototype instead:
const$$=(selector,startNode=D)=>startNode.querySelectorAll(selector)NodeList.prototype.map=Array.prototype.mapNodeList.prototype.on=function(type,listener,options){this.map(el=>{if(elinstanceofElement){el.addEventListener(type,listener,options)}})returnthis// for chaining}
This keeps the Array prototype clean =).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Another option is to attach the
on
method plusArray.prototype.map
to theNodeList
prototype instead:This keeps the Array prototype clean =).