Skip to content

Instantly share code, notes, and snippets.

@hughrawlinson
Last active February 11, 2016 11:43
Show Gist options
  • Save hughrawlinson/8084505 to your computer and use it in GitHub Desktop.
Save hughrawlinson/8084505 to your computer and use it in GitHub Desktop.
Private functions in ES5
module.exports = function(){
var self = {};
//constructor stuff here
var private = 1;
self.public = 2;
var privateFunction = function(){
console.log('this is a private function');
}
var publicFunction = function(){
console.log('this is a public function');
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment