Skip to content

Instantly share code, notes, and snippets.

@joshkehn
Created October 20, 2011 21:06
Show Gist options
  • Save joshkehn/1302384 to your computer and use it in GitHub Desktop.
Save joshkehn/1302384 to your computer and use it in GitHub Desktop.
function Student (name, age) {
this.name = name;
this.age = age;
}
Student.prototype.toString = function toString () {
return this.name + " is " + this.age + " years old.";
};
var me = new Student("Joshua", 26);
console.log(me.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment