This is my client JS script
var Chat = function(username) {
that = this;
this.myUser = {"username":username};
this.socket = io(server);
this.socket.on('connect', function(){
console.log(that.myUser); // this is UGLY but this.myUser will give an error
});
}
any idea of how to get rid of that nasty "that = this" ?