New module inside a module 2 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();
        }

       var str = strInput;
       this.getStr = function () {
           return str;
       }

       this.test = function () {
           var testModule = new MyModule("testInside");
           return testModule;
       }

   }

    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");
    var module2 = module.test();

    console.log(module2.getStr());
    console.log(module.getStr());
}
</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>

<p>Thanks in advance for your help.</p>
