Created
October 20, 2011 21:06
-
-
Save joshkehn/1302384 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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