Skip to content

Instantly share code, notes, and snippets.

@gumayunov
Forked from salmov/gist:363399
Created April 23, 2010 05:37
Show Gist options
  • Save gumayunov/376231 to your computer and use it in GitHub Desktop.
Save gumayunov/376231 to your computer and use it in GitHub Desktop.
$.extend(obj, (function(){
function private_function(){...}
function private_function2(){...}
return {
public_function: function() {...},
public_function2: function() {...}
}
})());
// ----
$.extend(obj, (function(){
var private_var = 1;
function private_function(){...}
function private_function2(){...}
function public_function() {...}
function public_function2() {...}
return {
func1: public_function,
func2: public_function2
}
})());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment