Skip to content

Instantly share code, notes, and snippets.

@michaelBenin
Created June 2, 2012 16:36
Show Gist options
  • Save michaelBenin/2859079 to your computer and use it in GitHub Desktop.
Save michaelBenin/2859079 to your computer and use it in GitHub Desktop.
(function()
{
function User()
{
var user = this;
this.set = function(key, value)
{
user[key] = value;
}
this.get = function(arg)
{
return user[arg];
}
}
var bob = new User();
bob.set('phone', '123-456-7890');
var bobsPhone = bob.get('phone');
alert(bobsPhone);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment