Created
February 21, 2018 15:19
-
-
Save mspreij/fb3d6c5c0d5cf1e4f01fec72c19317ac to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var yadda = (function() { | |
var myObject = {}; | |
var pubVar = 123; | |
var privVar = 456; | |
var someDefaultOptions = {}; | |
function public1() { | |
// ... | |
return 'allKindsOfInterestingStuff'; | |
} | |
function public2(x) { | |
var y = private1(x); | |
y += 'yay'; | |
return y; | |
} | |
// not for public use | |
function private1(inpupt) { | |
var output = mangle(input); | |
return output; | |
} | |
myObject.public1 = public1; | |
myObject.public2 = public2; | |
myObject.pubVar = pubVar; | |
return myObject; | |
})(); | |
foo = yadda.public1(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment