Skip to content

Instantly share code, notes, and snippets.

@endorama
Last active August 29, 2015 14:02
Show Gist options
  • Save endorama/69086f0388826dd06b1f to your computer and use it in GitHub Desktop.
Save endorama/69086f0388826dd06b1f to your computer and use it in GitHub Desktop.
Namespace JavaScript class prototype pattern
// define application namespace ( this is window )
this.Namespace = this.Namespace || {};
(function() {
"use strict";
function Foobar() {};
var p = Foobar.prototype; // = new Object(); // to extend Foobar
Namespace.Foobar = Foobar;
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment