/ Gists / All events in javascript
On gists

All events in javascript

JavaScript

code.js Raw #

Object.keys(window).forEach(key => {
  if (/^on/.test(key)) {
    window.addEventListener(key.slice(2), event => {
      console.log(event);
    });
  }
});