New module inside a module in javascript
<p>Here is my module:    </p>

<pre><code>MyModule = (function () {

    var myModule = function MyModule(strInput) {
        if (false === (this instanceof MyModule)) {
            return new MyModule();
        }

        str = strInput;
    }

    var str;
    myModule.prototype.getStr = function () {
        return str;
    }

    myModule.prototype.test = function () {
        var testModule = new MyModule("testInside");
        console.log(testModule.getStr());
        console.log(str);
    }

    return myModule;
}());
</code></pre>

<p>Here is how I test my module:</p>

<pre><code>document.getElementById("Button").onclick = function () {    
        var module = new MyModule("input");    
        module.test();    
    }
</code></pre>

<p>This code returns:    </p>

<pre><code>testInside   
testInside 
</code></pre>

<p>to the console.log, but what I expect is:    </p>

<pre><code>testInside    
input    
</code></pre>

<p>like I do in c# or java when I build a new class inside the same class.</p>
