function SomeClass(a){ this.a=a; } SomeClass.prototype.someDBAction = function(){ var instance=this; connection.query('some sql', function (sqlErr, results){ console.log(instance.a); }); };