Here is my module:

```
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;    
}());

```

Here is how I test my module:

```
document.getElementById("Button").onclick = function () {
    var module = new MyModule("input");
    var module2 = module.test();

    console.log(module2.getStr());
    console.log(module.getStr());
}

```

This code returns:

```
testInside   
testInside

```

to the console.log, but what I expect is: 

```
testInside    
input  

```

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

Thanks in advance for your help.