Created
October 11, 2011 18:35
-
-
Save Raynos/1278957 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
// classical | |
var Foo = function _construct(a) { | |
this.a = a; | |
} | |
Foo.prototype.lulz = function () {}; | |
Foo.prototype.prop = 42; | |
// new | |
var Foo = { | |
lulz: function () {}, | |
prop: 42, | |
constructor: function () { | |
this.a = a; | |
} | |
} | |
// init | |
var f = new Foo; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment