Last active
August 29, 2015 14:04
-
-
Save antoniocapelo/7614fb0cc74179ebfb80 to your computer and use it in GitHub Desktop.
Class creation and export on JavaScript
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
(function() { | |
var ClassName, root; | |
function ClassName (config) { | |
var privateProperty = 24; | |
this.publicProperty = 42; | |
privateMethod = function (foo) { | |
// do stuff | |
return true; | |
} | |
this.publicMethod = function (foo, bar) { | |
// do stuff | |
console.log(config); | |
return cenas; | |
}; | |
}; | |
ClassName.prototype.anotherPublicMethod = function() { | |
// do stuff | |
return cenas; | |
}; | |
root = typeof exports !== "undefined" && exports !== null ? exports : window; | |
root.ClassName = ClassName; | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment