Map JavaScript API
javascripture.com
javascripture.com
This is annoying. Is there some reason x.length wasn't used?
Maybe in Ecmascript 7 we'll finally get rid of
var me = this;
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
element.addEventListener('click', function(e) {
this.foo();
}.bind(this), false);
Notice the call to "bind" which binds the click handler function to the current object, so that inside it can call this.foo().element.addEventListener('click', e => this.foo(), false);