I am a C# developer experimenting with JavaScript and I\'m trying to get my head around the scope :)
I have the following code which contains an addEventListe
addEventListe
How about
function Keyboard() { this.keys = {}; var self = this; this.handle_keydown = function(args) { self.keys[args.keyCode] = true; } this.listen = function() { window.addEventListener('keydown', this.handle_keydown); } } app.util.keyboard = new Keyboard();