Skip to content

Instantly share code, notes, and snippets.

@amoslanka
Created October 16, 2013 22:48
Show Gist options
  • Save amoslanka/7016328 to your computer and use it in GitHub Desktop.
Save amoslanka/7016328 to your computer and use it in GitHub Desktop.
function Player(name, age, handicap, etc) {
this.name = name;
}
// VS.
function Player(name, age, handicap, etc) {
return {
name: name,
age: age,
handicap: handicap,
etc: etc,
exampleInstanceMethod: function(){
console.log("herp");
},
anotherExampleInstanceMethod: function(){
console.log("derp");
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment