Created
March 8, 2012 21:49
-
-
Save danieluhl/2003682 to your computer and use it in GitHub Desktop.
JavaScript Namespace
This file contains 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 (libraryNamespace, $, undefined) { | |
// private properties | |
var privateProperty = 'default private'; | |
// public properties | |
libraryNamespace.publicProperty = 'default public'; | |
// private methods | |
function updatePublicProperty(newPublic) { | |
this.publicProperty = newPublic || 'new public'; | |
} | |
// public methods | |
libraryNamespace.UpdatePrivateProperty = function (newPrivate) { | |
privateProperty = newPrivate || 'new private'; | |
this.publicProperty = 'new public'; | |
} | |
})(window.libraryNamespace = window.libraryNamespace || {}, jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment