Created
March 12, 2014 22:35
-
-
Save jtbonhomme/9517933 to your computer and use it in GitHub Desktop.
Self Invoking Functions
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
(function(global) { | |
'use strict'; | |
console.log("Self Invoking Function 2"); | |
var sif2 = { | |
prop2: 2, | |
meth2: function(){ | |
console.log("sif2.meth2"); | |
} | |
}; | |
global.sif2 = sif2; | |
})(this); | |
(function(global) { | |
'use strict'; | |
console.log("Self Invoking Function 1 %o", global); | |
var mysif = global.sif2; | |
mysif.meth2(); | |
})(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment