Keep `this` on prototype's object <p>I am trying to build a small javascript library for study purposes. I have an object inside a prototype that has some functions inside. I would like to access <code>this</code> (the one that has <code>valueOf</code> and stuff) from inside the functions, but <code>this</code> now brings me only the object parent to the functions.</p> <p>My code (coffee):</p> <pre><code>HTMLElement.prototype.on = click: (action) -&gt; @valueOf().addEventListener('click', action, false) # I'd like this to work, # but `this` here refers to the `on` object </code></pre> <p>Is this possible? I know I'm kinda reinventing the wheel, but as I said, it's for study purposes, so that's the idea.</p>