Skip to content

Instantly share code, notes, and snippets.

@fernandozamoraj
Last active April 16, 2017 19:31
Show Gist options
  • Save fernandozamoraj/4788c233441be54c825b83a6e73d7205 to your computer and use it in GitHub Desktop.
Save fernandozamoraj/4788c233441be54c825b83a6e73d7205 to your computer and use it in GitHub Desktop.
Js is it working and I don't know why
console.log(this);
(function(g, $) {
function MyRealLib(){
return function(s){
console.log(s);
};
}
g.ML$ = new MyRealLib();
g.ML$.foo = function(){
console.log("foo");
}
}(this, {}))
ML$("hi")
ML$.foo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment