Skip to content

Instantly share code, notes, and snippets.

@jtbonhomme
Created March 12, 2014 22:35
Show Gist options
  • Save jtbonhomme/9517933 to your computer and use it in GitHub Desktop.
Save jtbonhomme/9517933 to your computer and use it in GitHub Desktop.
Self Invoking Functions
(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