Skip to content

Instantly share code, notes, and snippets.

@csainty
Created March 10, 2012 01:33
Show Gist options
  • Save csainty/2009616 to your computer and use it in GitHub Desktop.
Save csainty/2009616 to your computer and use it in GitHub Desktop.
function createPerson(name) {
return {
name: name,
sayHello: function () {
console.log("Hello " + this.name);
}
}
}
var sue = createPerson('sue');
var bill = createPerson('bill');
sue.sayHello();
bill.sayHello();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment