The Setup One of the trickiest things to get right in javascript is this. To illustrate this point, let’s look at a situation we came across with one of my favorite browser APIs: addEventListener. Attaching a load event listener to the window object is pretty straight forward: 1 2 3 4 window.addEventListener('load', function(e) { // handle `load` event }) People start to get themselves into trouble when they assign references to instance methods and later want to execute those instance methods.