Last active
April 16, 2017 19:31
-
-
Save fernandozamoraj/4788c233441be54c825b83a6e73d7205 to your computer and use it in GitHub Desktop.
Js is it working and I don't know why
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
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