Skip to content

Instantly share code, notes, and snippets.

@damienwebdev
Created July 24, 2022 18:30
Show Gist options
  • Save damienwebdev/a33a135a61ad3fa250f59b12cdb65eeb to your computer and use it in GitHub Desktop.
Save damienwebdev/a33a135a61ad3fa250f59b12cdb65eeb to your computer and use it in GitHub Desktop.
Array.prototype.slice.call(document.querySelectorAll('*')).reduce(
(acc, el) => {
let listeners = getEventListeners(el);
if(Object.keys(listeners).length) {
acc[el.nodeName + el.className] = (acc[el.nodeName + el.className] ?? 0) + Object.keys(listeners).length
};
return acc;
},
{}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment