Skip to content

Instantly share code, notes, and snippets.

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