Skip to content

Instantly share code, notes, and snippets.

@sleekslush
Created July 26, 2011 19:58
Show Gist options
  • Save sleekslush/1107835 to your computer and use it in GitHub Desktop.
Save sleekslush/1107835 to your computer and use it in GitHub Desktop.
Javascript apply pattern
var Public = Public || {};
Public.Namespace = Public.Namespace || {};
(function() {
function concat(s1, s2) {
return s1 + s2;
}
this.sayHello = function(who) {
console.log(concat("Hello ", who));
}
}).apply(Public.Namespace);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment