Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created October 11, 2011 18:35
Show Gist options
  • Save Raynos/1278957 to your computer and use it in GitHub Desktop.
Save Raynos/1278957 to your computer and use it in GitHub Desktop.
// 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