I have this function:
(function(window, document,undefined) {
'use strict';
function Test() {
this.init = function() {
console.log("init");
}
};
return new Test;
})(window, document);
I know that class Test is only accessible only in this context.
But I want to do this:
Test.init();
If I store it into one variable and do like this:
var t = (function() {...})();
and do console.log(t) it will return the class itself and then, I can retrieve it. But I don't want to do that method
I was wondering, is there a way to retrieve this class from this Javascript Self Invoking Functions? How can achieve it, if it is possible?
Here's a fiddle that I'm working with: http://jsfiddle.net/grnagwg8/
Regards,
Testdon't wrap it in an IIFE ?