Correction of Listing 2-25 in Pro Javascript Techniques

function User(properties) {
        for (var i in properties) {
                (function(){
                        var key = i;
                        this['get' + key] = function() {
                                return properties[key];
                        };
                        this['set' + key] = function(val) {
                                properties[key];
                        };
                }).call(this);
        }
}