Skip to content

Instantly share code, notes, and snippets.

@csainty
Created March 14, 2012 01:20
Show Gist options
  • Save csainty/2033188 to your computer and use it in GitHub Desktop.
Save csainty/2033188 to your computer and use it in GitHub Desktop.
function createPerson(name) {
var _name = name;
return {
sayHello: function () {
console.log("Hello " + _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