Skip to content

Instantly share code, notes, and snippets.

@otang
Created June 9, 2013 07:31
Show Gist options
  • Save otang/5742500 to your computer and use it in GitHub Desktop.
Save otang/5742500 to your computer and use it in GitHub Desktop.
var person = function() {
var name = null,
age = null,
hair = null;
return {
birth: function() {
name = 'Chris';
age = 27;
hair = 'blonde';
},
getAge: function() {
return age;
}
};
}();
person.birth();
alert(person.getAge());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment