Skip to content

Instantly share code, notes, and snippets.

@spacenick
Created April 20, 2015 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spacenick/d5f831af82948bc47aa8 to your computer and use it in GitHub Desktop.
Save spacenick/d5f831af82948bc47aa8 to your computer and use it in GitHub Desktop.
private functions
/// Everything defined here is defined in the scope of that module
/// so it wont pollute anything
var privateVar = "test";
var privateFn = function() {
// process stuff here
// we can use privateVar
}
module.exports = function(arg) {
var res = privateFn(arg);
// do stuff
return res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment