Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var bla = (function() {
- function priv() {
- return 2;
- }
- // Public methods
- return {
- pub: function() {
- return priv();
- }
- }
- })();
- function Bla1() {
- priv = function() {
- return 2;
- }
- // Public methods
- this.pub = function () {
- return priv();
- }
- }
- var bla2 = {
- _priv: function() {
- return 2;
- },
- pub: function() {
- return this._priv();
- }
- };
- // Main gate
- (function() {
- console.log(bla2.pub());
- })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement