Last active
February 11, 2016 11:43
-
-
Save hughrawlinson/8084505 to your computer and use it in GitHub Desktop.
Private functions in ES5
This file contains 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
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