Created
May 21, 2015 16:00
-
-
Save klaemo/5b4ab529b2e02fb42361 to your computer and use it in GitHub Desktop.
constructor
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 MyThing (name) { | |
this.name = name | |
} | |
MyThing.prototype.sayHello = function () { | |
return 'hello ' + this.name | |
} | |
var thing = new MyThing('Erik') | |
thing.sayHello() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment